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.
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/filemerge.py (1 line) | |||
M | tests/test-merge-halt.t (7 lines) |
Commit | Local | Parents | Author | Summary | Date |
---|---|---|---|---|---|
807b93d3ba9e | 37527 | add1a87695de | Ryan McElroy | merge: allow user to halt merge on merge-tool failures | Oct 4 2017, 9:58 AM |
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)') |
Halting works on first failure | Halting works on first failure | ||||
$ echo onfailure=halt >> $HGRCPATH | $ echo onfailure=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 | ||||
Prompting works when selected | Prompting works when selected | ||||
$ echo onfailure=prompt >> $HGRCPATH | $ echo onfailure=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 | ||||