merge: allow user to halt merge on merge-tool failures
Depends on D932.
Call the new _onfilemergefailure function when a merge tool reports failure
via a return code.
Differential Revision: https://phab.mercurial-scm.org/D951
--- a/mercurial/filemerge.py Fri Oct 06 06:48:43 2017 -0700
+++ b/mercurial/filemerge.py Fri Oct 06 06:48:43 2017 -0700
@@ -739,6 +739,7 @@
if r:
if onfailure:
ui.warn(onfailure % fd)
+ _onfilemergefailure(ui)
return True, r, deleted
finally:
--- a/tests/test-merge-halt.t Fri Oct 06 06:48:43 2017 -0700
+++ b/tests/test-merge-halt.t Fri Oct 06 06:48:43 2017 -0700
@@ -44,8 +44,7 @@
merging a
merging b
merging a failed!
- merging b failed!
- unresolved conflicts (see hg resolve, then hg rebase --continue)
+ merge halted after failed merge (see hg resolve)
[1]
$ hg resolve --list
@@ -65,8 +64,10 @@
merging a
merging b
merging a failed!
+ continue merge operation (yn)? y
merging b failed!
- unresolved conflicts (see hg resolve, then hg rebase --continue)
+ continue merge operation (yn)? n
+ merge halted after failed merge (see hg resolve)
[1]
$ hg resolve --list