Depends on D932.
Call the new _onfilemergefailure function when a merge tool reports failure
via a return code.
Depends on D932.
Call the new _onfilemergefailure function when a merge tool reports failure
via a return code.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/filemerge.py (1 line) | |||
M | tests/test-merge-halt.t (7 lines) |
toolconf, files, labels=labels) | toolconf, files, labels=labels) | ||||
if needcheck: | if needcheck: | ||||
r = _check(repo, r, ui, tool, fcd, files) | r = _check(repo, r, ui, tool, fcd, files) | ||||
if r: | if r: | ||||
if onfailure: | if onfailure: | ||||
ui.warn(onfailure % fd) | ui.warn(onfailure % fd) | ||||
_onfilemergefailure(ui) | |||||
return True, r, deleted | return True, r, deleted | ||||
finally: | finally: | ||||
if not r and back is not None: | if not r and back is not None: | ||||
util.unlink(back) | util.unlink(back) | ||||
def _haltmerge(): | def _haltmerge(): | ||||
msg = _('merge halted after failed merge (see hg resolve)') | msg = _('merge halted after failed merge (see hg resolve)') |
Testing on-failure=halt | Testing on-failure=halt | ||||
$ echo on-failure=halt >> $HGRCPATH | $ echo on-failure=halt >> $HGRCPATH | ||||
$ hg rebase -s 1 -d 2 --tool false | $ hg rebase -s 1 -d 2 --tool false | ||||
rebasing 1:1f28a51c3c9b "c" | rebasing 1:1f28a51c3c9b "c" | ||||
merging a | merging a | ||||
merging b | merging b | ||||
merging a failed! | merging a failed! | ||||
merging b failed! | merge halted after failed merge (see hg resolve) | ||||
unresolved conflicts (see hg resolve, then hg rebase --continue) | |||||
[1] | [1] | ||||
$ hg resolve --list | $ hg resolve --list | ||||
U a | U a | ||||
U b | U b | ||||
$ hg rebase --abort | $ hg rebase --abort | ||||
rebase aborted | rebase aborted | ||||
Testing on-failure=prompt | Testing on-failure=prompt | ||||
$ echo on-failure=prompt >> $HGRCPATH | $ echo on-failure=prompt >> $HGRCPATH | ||||
$ cat <<EOS | hg rebase -s 1 -d 2 --tool false --config ui.interactive=1 | $ cat <<EOS | hg rebase -s 1 -d 2 --tool false --config ui.interactive=1 | ||||
> y | > y | ||||
> n | > n | ||||
> EOS | > EOS | ||||
rebasing 1:1f28a51c3c9b "c" | rebasing 1:1f28a51c3c9b "c" | ||||
merging a | merging a | ||||
merging b | merging b | ||||
merging a failed! | merging a failed! | ||||
continue merge operation (yn)? y | |||||
merging b failed! | 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] | [1] | ||||
$ hg resolve --list | $ hg resolve --list | ||||
U a | U a | ||||
U b | U b | ||||
$ hg rebase --abort | $ hg rebase --abort | ||||
rebase aborted | rebase aborted | ||||