--- a/CHANGELOG Wed Jun 26 21:11:25 2019 +0530
+++ b/CHANGELOG Thu Jul 04 16:55:57 2019 +0200
@@ -9,6 +9,13 @@
* evolve: improve `hg evolve --all` behavior when "." is obsolete
* topic: fix confusion in branch heads checking logic
+9.0.1 - in progress
+-------------------
+
+ * pick: no longer forget file in case of conflict (issue6037)
+ * pick: properly report and cleanup "unfinished state"
+ * prune: don't update wcp if pruned revision are unrelated (issue6137)
+ * evolve: properly prune changeset with no change in case of conflict (issue5967)
9.0.0 -- 2019-06-06
-------------------
--- a/debian/control Wed Jun 26 21:11:25 2019 +0530
+++ b/debian/control Thu Jul 04 16:55:57 2019 +0200
@@ -7,14 +7,14 @@
Pierre-Yves David <pierre-yves.david@logilab.fr>,
Standards-Version: 3.9.3
Build-Depends:
- mercurial (>= 4.1),
+ mercurial (>= 4.5),
python,
debhelper (>= 8),
python-sphinx (>= 1.0.8),
imagemagick,
librsvg2-bin,
wget,
-Python-Version: >= 2.6
+X-Python-Version: >= 2.7
Homepage: https://www.mercurial-scm.org/doc/evolution/
Package: mercurial-evolve
@@ -22,7 +22,7 @@
Depends:
${python:Depends},
${misc:Depends},
- mercurial (>= 4.1),
+ mercurial (>= 4.5),
Description: evolve extension for Mercurial
This package provides the experimental "evolve" extension for the Mercurial
DVCS.
--- a/hgext3rd/evolve/__init__.py Wed Jun 26 21:11:25 2019 +0530
+++ b/hgext3rd/evolve/__init__.py Thu Jul 04 16:55:57 2019 +0200
@@ -1367,9 +1367,12 @@
statemod.addunfinished('pick', fname='pickstate', continueflag=True)
else:
# compat <= hg-5.0 (5f2f6912c9e6)
- data = ('evolvestate', False, False, _('evolve in progress'),
- _("use 'hg evolve --continue' or 'hg evolve --abort' to abort"))
- cmdutil.unfinishedstates.append(data)
+ estate = ('evolvestate', False, False, _('evolve in progress'),
+ _("use 'hg evolve --continue' or 'hg evolve --abort' to abort"))
+ cmdutil.unfinishedstates.append(estate)
+ pstate = ('pickstate', False, False, _('pick in progress'),
+ _("use 'hg pick --continue' or 'hg pick --abort' to abort"))
+ cmdutil.unfinishedstates.append(pstate)
afterresolved = ('evolvestate', _('hg evolve --continue'))
pickresolved = ('pickstate', _('hg pick --continue'))
--- a/hgext3rd/evolve/cmdrewrite.py Wed Jun 26 21:11:25 2019 +0530
+++ b/hgext3rd/evolve/cmdrewrite.py Thu Jul 04 16:55:57 2019 +0200
@@ -1063,16 +1063,24 @@
wdp = repo['.']
- if len(sucs) == 1 and len(precs) == 1 and wdp in precs:
- # '.' killed, so update to the successor
- newnode = sucs[0]
+ if wdp in precs:
+ if len(sucs) == 1 and len(precs) == 1:
+ # '.' killed, so update to the successor
+ newnode = sucs[0]
+ elif biject:
+ # find the exact successor of '.'
+ newnode = sucs[precs.index(wdp)]
+ else:
+ # update to an unkilled parent
+ newnode = wdp
+
+ while newnode in precs or newnode.obsolete():
+ newnode = newnode.parents()[0]
else:
- # update to an unkilled parent
+ # no need to update anywhere as wdp is not related to revs
+ # being pruned
newnode = wdp
- while newnode in precs or newnode.obsolete():
- newnode = newnode.parents()[0]
-
if newnode.node() != wdp.node():
if opts.get('keep', False):
# This is largely the same as the implementation in
@@ -1430,7 +1438,7 @@
if opts.get('rev'):
revs.append(opts['rev'])
- with repo.wlock(), repo.lock(), repo.transaction('pick'):
+ with repo.wlock(), repo.lock():
pickstate = state.cmdstate(repo, path='pickstate')
pctx = repo['.']
@@ -1471,6 +1479,7 @@
ui.status(_("aborting pick, updating to %s\n") %
node.hex(pctxnode)[:12])
hg.updaterepo(repo, pctxnode, True)
+ pickstate.delete()
return 0
else:
--- a/hgext3rd/evolve/evolvecmd.py Wed Jun 26 21:11:25 2019 +0530
+++ b/hgext3rd/evolve/evolvecmd.py Thu Jul 04 16:55:57 2019 +0200
@@ -2051,8 +2051,11 @@
if node is None:
repo.ui.status(_("evolution of %d:%s created no changes"
" to commit\n") % (ctx.rev(), ctx))
- newctx = repo[node] if node is not None else repo['.']
- obsolete.createmarkers(repo, [(ctx, (newctx,))], operation='evolve')
+ replacement = ()
+ else:
+ replacement = (repo[node],)
+
+ obsolete.createmarkers(repo, [(ctx, replacement)], operation='evolve')
# make sure we are continuing evolve and not `hg next --evolve`
if evolvestate['command'] == 'evolve':
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-evolve-issue5967.t Thu Jul 04 16:55:57 2019 +0200
@@ -0,0 +1,74 @@
+hg evolve --continue and obsmarkers after conflict resolution with no changes to commit (issue5967)
+https://bz.mercurial-scm.org/show_bug.cgi?id=5967
+
+ $ . $TESTDIR/testlib/common.sh
+
+ $ hg init issue5967
+ $ cd issue5967
+ $ cat > .hg/hgrc << EOF
+ > [alias]
+ > glog = log -GT "{rev}: {desc}"
+ > [extensions]
+ > evolve=
+ > EOF
+
+ $ echo apple > a
+ $ hg ci -qAm 'apple'
+ $ echo banana > a
+ $ hg ci -m 'banana'
+
+Amending revision 0 in a way that causes conflicts
+
+ $ hg prev
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ [0] apple
+ $ echo apricot > a
+ $ hg amend -m 'apricot'
+ 1 new orphan changesets
+
+ $ hg glog
+ @ 2: apricot
+
+ * 1: banana
+ |
+ x 0: apple
+
+
+Trying to evolve, then manually discarding changes from revision 1
+
+ $ hg evolve
+ move:[1] banana
+ atop:[2] apricot
+ merging a
+ warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
+ unresolved merge conflicts
+ (see 'hg help evolve.interrupted')
+ [1]
+
+ $ echo apricot > a
+ $ hg resolve --mark a
+ (no more unresolved files)
+ continue: hg evolve --continue
+
+This will correctly notice that revision 1 can be dropped
+
+ $ hg evolve --continue
+ evolving 1:dd9b5dd30cd6 "banana"
+ evolution of 1:dd9b5dd30cd6 created no changes to commit
+ working directory is now at 4d6fec23dcc4
+ $ hg glog
+ @ 2: apricot
+
+
+This is important: 1 should not have a successor (especially not revision 2)
+
+ $ hg olog --all
+ @ 4d6fec23dcc4 (2) apricot
+ |
+ x 3ba7db0ce860 (0) apple
+ rewritten(description, content) as 4d6fec23dcc4 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+
+ $ hg olog --hidden --all 1
+ x dd9b5dd30cd6 (1) banana
+ pruned using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+
--- a/tests/test-pick.t Wed Jun 26 21:11:25 2019 +0530
+++ b/tests/test-pick.t Thu Jul 04 16:55:57 2019 +0200
@@ -3,6 +3,7 @@
$ cat >> $HGRCPATH <<EOF
> [alias]
> glog = log -G -T "{rev}:{node|short} {desc}\n"
+ > glf = log -GT "{rev}: {desc} ({files})\n"
> [extensions]
> EOF
$ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
@@ -386,3 +387,62 @@
o d03a6bcc83cd: default
$ cd ..
+
+Check that pick doesn't drop files after conflicts occur (issue6037)
+--------------------------------------------------------------------
+
+ $ hg init issue6037
+ $ cd issue6037
+
+ $ echo apple > a
+ $ hg ci -qAm 'apple'
+
+ $ echo apricot > a
+ $ echo banana > b
+ $ hg ci -qAm 'apricot and banana'
+
+ $ echo avocado > a
+ $ hg ci -m 'avocado'
+
+ $ hg glf
+ @ 2: avocado (a)
+ |
+ o 1: apricot and banana (a b)
+ |
+ o 0: apple (a)
+
+Now let's change order of 1 and 2 using pick command
+
+ $ hg up -r 0
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+We avoid merge conflict here just to make the test shorter
+
+ $ hg pick -r 2 --tool :other
+ picking 2:f08a1e4a33c4 "avocado"
+
+Now we pick revision 1 that touches two files (a and b), merge conflict is expected
+
+ $ hg pick -r 1
+ picking 1:892e123ebf62 "apricot and banana"
+ merging a
+ warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
+ unresolved merge conflicts (see hg help resolve)
+ [1]
+ $ hg resolve -t :other a
+ (no more unresolved files)
+ continue: hg pick --continue
+ $ hg pick --continue
+
+Demonstrate that b was not forgotten and is definitely included in 4
+
+ $ hg status b -A
+ C b
+ $ hg glf
+ @ 4: apricot and banana (a b)
+ |
+ o 3: avocado (a)
+ |
+ o 0: apple (a)
+
+ $ cd ..
--- a/tests/test-prune.t Wed Jun 26 21:11:25 2019 +0530
+++ b/tests/test-prune.t Thu Jul 04 16:55:57 2019 +0200
@@ -229,17 +229,18 @@
814c38b95e72dfe2cbf675b1649ea9d780c89a80 6f6f25e4f748d8f7571777e6e168aedf50350ce8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'prune', 'user': 'test'}
354011cd103f58bbbd9091a3cee6d6a6bd0dddf7 6f6f25e4f748d8f7571777e6e168aedf50350ce8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'prune', 'user': 'test'}
-two old, two new with --pair
+two old, two new with --pair (also test bookmark move)
$ hg up 0
0 files updated, 0 files merged, 4 files removed, 0 files unresolved
+ $ hg bookmark prune-pair-book
$ mkcommit n1
created new head
$ mkcommit n2
$ hg prune 'desc("add n1")::desc("add n2")' -s 'desc("add nD")::desc("add nE")' --pair
- 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
- working directory is now at 1f0dee641bb7
+ 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ working directory is now at 6e8148413dd5
2 changesets pruned
$ hg debugobsolete
9d206ffc875e1bc304590549be293be36821e66c 0 {47d2a3944de8b013de3be9578e8e344ea2e6c097} (Sat Dec 15 00:00:00 1979 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'blah'}
@@ -252,11 +253,15 @@
354011cd103f58bbbd9091a3cee6d6a6bd0dddf7 6f6f25e4f748d8f7571777e6e168aedf50350ce8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'prune', 'user': 'test'}
cb7f8f706a6532967b98cf8583a81baab79a0fa7 8ee176ff1d4b2034ce51e3efc579c2de346b631d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'prune', 'user': 'test'}
21b6f2f1cece8c10326e575dd38239189d467190 6e8148413dd541855b72a920a90c06fca127c7e7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'prune', 'user': 'test'}
+ $ hg log --hidden -r 'desc("add n2") + desc("add nE") + bookmark("prune-pair-book")'
+ 14:21b6f2f1cece[] (obsolete/draft) add n2
+ 12:6e8148413dd5[prune-pair-book] (draft) add nE
test hg strip replacement
$ hg up 10
- 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ (leaving bookmark prune-pair-book)
$ mkcommit n1
created new head
$ mkcommit n2
@@ -454,3 +459,45 @@
r10 8:d62d843c9a01
rg 15:cd0038e05e1b
+ $ cd ..
+
+Test that prune doesn't update off when pruning unrelated commit (issue6137)
+----------------------------------------------------------------------------
+
+ $ hg init issue6137
+ $ cd issue6137
+ $ echo a > a
+ $ hg ci -Aqm "added a"
+ $ echo b > b
+ $ hg ci -Aqm "added b"
+
+ $ hg prune .
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ working directory is now at 9092f1db7931
+ 1 changesets pruned
+
+ $ echo c > c
+ $ hg ci -Aqm "added c"
+
+update to obsoleted revision and perform prune on unrelated revision:
+ $ hg up -r "desc('added b')" --hidden -q
+ updated to hidden changeset 5f6d8a4bf34a
+ (hidden revision '5f6d8a4bf34a' is pruned)
+ working directory parent is obsolete! (5f6d8a4bf34a)
+
+ $ hg log -G
+ o 2:29edef26570b[] (draft) added c
+ |
+ | @ 1:5f6d8a4bf34a[] (obsolete/draft) added b
+ |/
+ o 0:9092f1db7931[] (draft) added a
+
+ $ hg prune -r "desc('added c')"
+ 1 changesets pruned
+
+ $ hg par
+ 1:5f6d8a4bf34a[] (obsolete/draft) added b
+ working directory parent is obsolete! (5f6d8a4bf34a)
+ (use 'hg evolve' to update to its parent successor)
+
+ $ cd ..