D953: merge: use filemerge failure handler in post-filemerge checks checks
ryanmce (Ryan McElroy)
phabricator at mercurial-scm.org
Thu Oct 5 09:17:28 UTC 2017
ryanmce created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Depends on https://phab.mercurial-scm.org/D952.
This allows the user to halt the merge if conflict markers or no changes are
found in the merged file as well.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D953
AFFECTED FILES
mercurial/filemerge.py
tests/test-merge-halt.t
CHANGE DETAILS
diff --git a/tests/test-merge-halt.t b/tests/test-merge-halt.t
--- a/tests/test-merge-halt.t
+++ b/tests/test-merge-halt.t
@@ -85,7 +85,6 @@
merging b
output file a appears unchanged
was merge successful (yn)? n
- merging a failed!
merge halted after failed merge (see hg resolve)
[1]
@@ -118,20 +117,24 @@
merging a
merging b
was merge of 'a' successful (yn)? n
- merging a failed!
merge halted after failed merge (see hg resolve)
[1]
$ hg rebase --abort
rebase aborted
Check that a requested abort actually works
+ $ cat <<EOS >> $HGRCPATH
+ > [merge]
+ > onfailure=prompt
+ > EOS
$ cat <<EOS | hg rebase -s 1 -d 2 --tool false --config ui.interactive=1
> n
> EOS
rebasing 1:1f28a51c3c9b "c"
merging a
merging b
merging a failed!
+ continue merge operation (yn)? n
merge halted after failed merge (see hg resolve)
[1]
diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -753,6 +753,7 @@
if ui.promptchoice(_("was merge of '%s' successful (yn)?"
"$$ &Yes $$ &No") % fd, 1):
r = 1
+ _onfilemergefailure(ui)
if not r and not checked and (_toolbool(ui, tool, "checkchanged") or
'changed' in
@@ -762,6 +763,7 @@
"was merge successful (yn)?"
"$$ &Yes $$ &No") % fd, 1):
r = 1
+ _onfilemergefailure(ui)
if back is not None and _toolbool(ui, tool, "fixeol"):
_matcheol(_workingpath(repo, fcd), back)
To: ryanmce, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list