evolve: raise error.InterventionRequired instead of Abort when conflicts
error.InterventionRequired is a better error to raise in such cases.
Thanks to marmoute for noticing this.
--- a/hgext3rd/evolve/evolvecmd.py Thu Jun 14 02:58:30 2018 +0200
+++ b/hgext3rd/evolve/evolvecmd.py Fri Jun 15 00:16:29 2018 +0530
@@ -180,8 +180,8 @@
ops = {'current': orig.node()}
evolvestate.addopts(ops)
evolvestate.save()
- raise error.Abort(_("fix conflicts and see `hg help "
- "evolve.interrupted`"))
+ raise error.InterventionRequired(_("fix conflicts and see `hg help "
+ "evolve.interrupted`"))
def _solvephasedivergence(ui, repo, bumped, evolvestate, dryrun=False,
confirm=False, progresscb=None):
@@ -250,8 +250,8 @@
evolvestate['current'] = bumped.hex()
evolvestate['precursor'] = prec.hex()
evolvestate.save()
- raise error.Abort(_("fix conflicts and see `hg help "
- "evolve.interrupted`"))
+ raise error.InterventionRequired(_("fix conflicts and see `hg help "
+ "evolve.interrupted`"))
return _resolvephasedivergent(ui, repo, prec, bumped, tmpctx)
@@ -516,8 +516,8 @@
tr = repo.currenttransaction()
tr.close()
evolvestate.save()
- raise error.Abort(_("fix conflicts and see `hg help "
- "evolve.interrupted`"))
+ raise error.InterventionRequired(_("fix conflicts and see `hg help "
+ "evolve.interrupted`"))
def _completecontentdivergent(ui, repo, progresscb, divergent, other,
base, evolvestate):
--- a/tests/test-evolve-abort-contentdiv.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-abort-contentdiv.t Fri Jun 15 00:16:29 2018 +0530
@@ -78,8 +78,8 @@
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg status -v
M d
@@ -177,8 +177,8 @@
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --abort
2 new content-divergent changesets
@@ -338,8 +338,8 @@
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --abort
evolve aborted
--- a/tests/test-evolve-abort-orphan.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-abort-orphan.t Fri Jun 15 00:16:29 2018 +0530
@@ -85,8 +85,8 @@
atop:[5] added c
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --abort
evolve aborted
@@ -117,8 +117,8 @@
atop:[5] added c
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foo > d
$ hg resolve -m
(no more unresolved files)
@@ -145,8 +145,8 @@
atop:[8] added b
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
testing that interrupted evolve shows up in morestatus
$ hg status -v
@@ -256,8 +256,8 @@
atop:[7] added a
merging a
warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg glog
o 9:7f8e8bd9f0b6 added c
@@ -320,8 +320,8 @@
atop:[7] added a
merging a
warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg glog
o 9:7f8e8bd9f0b6 added c
| () draft
@@ -397,8 +397,8 @@
atop:[7] added a
merging a
warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg glog
o 12:1c476940790a added d
@@ -473,8 +473,8 @@
atop:[5] added b
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg glog
@ 5:c1f4718020e3 added b
@@ -519,8 +519,8 @@
atop:[5] added b
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --abort
evolve aborted
--- a/tests/test-evolve-abort-phasediv.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-abort-phasediv.t Fri Jun 15 00:16:29 2018 +0530
@@ -87,8 +87,8 @@
rebasing to destination parent: ca1b80f7960a
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
testing that interrupted evolve shows up in morestatus
$ hg status -v
@@ -199,8 +199,8 @@
rebasing to destination parent: b1661037fa25
merging b
warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --abort
1 new phase-divergent changesets
@@ -268,8 +268,8 @@
rebasing to destination parent: b1661037fa25
merging b
warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo watwat > c
$ hg resolve -m
@@ -284,8 +284,8 @@
rebasing to destination parent: ca1b80f7960a
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --abort
1 new phase-divergent changesets
--- a/tests/test-evolve-content-divergence.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-content-divergence.t Fri Jun 15 00:16:29 2018 +0530
@@ -177,8 +177,8 @@
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foobar > d
$ hg resolve -m
@@ -237,8 +237,8 @@
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo watbar > d
$ hg resolve -m
@@ -534,8 +534,8 @@
merging y
warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo watbar > y
$ hg resolve -m
--- a/tests/test-evolve-continue.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-continue.t Fri Jun 15 00:16:29 2018 +0530
@@ -58,8 +58,8 @@
atop:[5] added c
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foo > d
$ hg resolve -m
@@ -115,8 +115,8 @@
atop:[8] added d
merging e
warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo bar > e
$ hg resolve -m
@@ -154,8 +154,8 @@
atop:[9] added a
merging b
warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foo > b
$ hg resolve -m
@@ -240,8 +240,8 @@
atop:[17] added d
merging f
warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foo > f
$ hg resolve -m
@@ -255,8 +255,8 @@
atop:[19] added g
merging h
warning: conflicts while merging h! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foo > h
$ hg resolve -m
@@ -301,8 +301,8 @@
perform evolve? [Ny] y
merging g
warning: conflicts while merging g! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foo > g
$ hg resolve -m
@@ -351,8 +351,8 @@
atop:[24] added f
merging g
warning: conflicts while merging g! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foo > g
$ hg resolve -m
(no more unresolved files)
--- a/tests/test-evolve-orphan-merge.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-orphan-merge.t Fri Jun 15 00:16:29 2018 +0530
@@ -219,8 +219,8 @@
atop:[11] foo to c
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo FOObar > c
$ hg resolve -m
@@ -274,8 +274,8 @@
atop:[13] foo to c
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foobar > c
$ hg resolve -m
--- a/tests/test-evolve-phase-divergence.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-phase-divergence.t Fri Jun 15 00:16:29 2018 +0530
@@ -792,8 +792,8 @@
rebasing to destination parent: 8c2bb6fb44e9
merging x
warning: conflicts while merging x! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg diff
diff -r 8c2bb6fb44e9 l
--- a/tests/test-evolve-phase.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-phase.t Fri Jun 15 00:16:29 2018 +0530
@@ -86,8 +86,8 @@
atop:[3] b
merging a
warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg diff
diff -r 87495ea7c9ec a
--- a/tests/test-evolve-stop-contentdiv.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-stop-contentdiv.t Fri Jun 15 00:16:29 2018 +0530
@@ -75,8 +75,8 @@
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --stop
stopped the interrupted evolve
@@ -129,8 +129,8 @@
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --stop
stopped the interrupted evolve
--- a/tests/test-evolve-stop-orphan.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-stop-orphan.t Fri Jun 15 00:16:29 2018 +0530
@@ -90,8 +90,8 @@
atop:[5] added c
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --stop
stopped the interrupted evolve
@@ -136,8 +136,8 @@
atop:[5] added c
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg diff
diff -r cb6a2ab625bb d
@@ -183,8 +183,8 @@
atop:[5] added c
merging d
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foo > d
$ hg resolve -m
(no more unresolved files)
@@ -234,8 +234,8 @@
atop:[9] added b
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg status
M c
@@ -271,8 +271,8 @@
atop:[9] added b
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ echo foobar > c
$ hg resolve -m
@@ -347,8 +347,8 @@
atop:[13] added b
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --stop
stopped the interrupted evolve
--- a/tests/test-evolve-stop-phasediv.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve-stop-phasediv.t Fri Jun 15 00:16:29 2018 +0530
@@ -84,8 +84,8 @@
rebasing to destination parent: ca1b80f7960a
merging c
warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg evolve --stop
stopped the interrupted evolve
--- a/tests/test-evolve.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-evolve.t Fri Jun 15 00:16:29 2018 +0530
@@ -1535,8 +1535,8 @@
atop:[38] will be evolved safely
merging newfile
warning: conflicts while merging newfile! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ glog -r "be23044af550::" --hidden
@ 38:61abd81de026@default(draft) will be evolved safely
--- a/tests/test-issue-5720.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-issue-5720.t Fri Jun 15 00:16:29 2018 +0530
@@ -61,8 +61,8 @@
atop:[3] b
merging a
warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
Fix the conflict
$ echo c2 > a
--- a/tests/test-stabilize-conflict.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-stabilize-conflict.t Fri Jun 15 00:16:29 2018 +0530
@@ -128,8 +128,8 @@
atop:[5] babar count up to ten
merging babar
warning: conflicts while merging babar! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg resolve -l
U babar
$ hg log -G
@@ -220,8 +220,8 @@
output file babar appears unchanged
was merge successful (yn)? n
merging babar failed!
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg resolve -l
U babar
$ hg log -G
--- a/tests/test-stabilize-result.t Thu Jun 14 02:58:30 2018 +0200
+++ b/tests/test-stabilize-result.t Fri Jun 15 00:16:29 2018 +0530
@@ -81,8 +81,8 @@
atop:[5] changea
merging a
warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ hg revert -r "orphan()" a
$ hg diff
diff -r 66719795a494 a
@@ -390,8 +390,8 @@
merging a
warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
- abort: fix conflicts and see `hg help evolve.interrupted`
- [255]
+ fix conflicts and see `hg help evolve.interrupted`
+ [1]
$ cat > a <<EOF
> jungle