evolve: make `--continue` continue evolving all remaining revisions
This patch makes `hg evolve --continue` to continue all remaining revisions
instead of just the current conflicted one.
There are some still improvements required to this behavior after which the
CHANGELOG entry will be added.
--- a/hgext3rd/evolve/evolvecmd.py Sun Feb 04 20:58:03 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py Wed Jan 24 13:20:18 2018 +0530
@@ -1144,6 +1144,17 @@
obsolete.createmarkers(repo, [(ctx, (repo[node],))])
else:
obsolete.createmarkers(repo, [(ctx, (repo['.'],))])
+ evolvestate['replacements'][ctx.node()] = node
+ category = evolvestate['category']
+ unfi = repo.unfiltered()
+ for rev in evolvestate['revs']:
+ # XXX: prevent this lookup by storing nodes instead of revnums
+ curctx = unfi[rev]
+ if curctx.node() not in evolvestate['replacements']:
+ newnode = _solveone(ui, repo, curctx, evolvestate, False,
+ False, progresscb, category)
+ if newnode[0]:
+ evolvestate['replacements'][curctx.node()] = newnode[1]
evolvestate.delete()
return
--- a/tests/test-evolve-continue.t Sun Feb 04 20:58:03 2018 +0530
+++ b/tests/test-evolve-continue.t Wed Jan 24 13:20:18 2018 +0530
@@ -168,31 +168,10 @@
continue: hg evolve --continue
$ hg evolve --continue
evolving 2:b1661037fa25 "added b"
-
- $ hg glog
- @ 10:87f748868183 added b
- | () draft
- o 9:53b632d203d8 added a
- | () draft
- | * 8:00a5c774cc37 added d
- | | () draft
- | * 5:cb6a2ab625bb added c
- | | () draft
- | x 2:b1661037fa25 added b
- | | () draft
- | x 1:c7586e2a9264 added a
- |/ () draft
- o 0:8fa14d15e168 added hgignore
- () draft
-
-XXX: we should not have required an extra call to `hg evolve` here
-
- $ hg evolve --all
move:[5] added c
atop:[10] added b
move:[8] added d
atop:[11] added c
- working directory is now at 6642d2c9176e
$ hg glog
@ 12:6642d2c9176e added d
@@ -276,10 +255,6 @@
continue: hg evolve --continue
$ hg evolve --continue
evolving 13:be88f889b6dc "added f"
-
-XXX: we should not require this extra `hg evolve --all` call
-
- $ hg evolve --all
move:[14] added g
atop:[18] added f
move:[15] added h
@@ -343,18 +318,12 @@
(no more unresolved files)
continue: hg evolve --continue
-XXX: so this evolve should continue the rest of evolve and ask for confirmation
-before evolving. evolve --continue is broken right now and should be fixed.
+XXX: this should have asked for confirmation
$ hg evolve --continue
evolving 19:981e615b14ca "added g"
-
-XXX: we should not need this extra call to evolve
-
- $ hg evolve --all
move:[20] added h
atop:[22] added g
- working directory is now at af6bd002a48d
$ hg glog
@ 23:af6bd002a48d added h