diff -r 530b7361e3a9 -r ed91846c29cf mercurial/filemerge.py --- a/mercurial/filemerge.py Sun Oct 15 19:29:56 2017 +0530 +++ b/mercurial/filemerge.py Fri Oct 06 06:48:43 2017 -0700 @@ -745,6 +745,20 @@ if not r and back is not None: back.remove() +def _haltmerge(): + msg = _('merge halted after failed merge (see hg resolve)') + raise error.InterventionRequired(msg) + +def _onfilemergefailure(ui): + action = ui.config('merge', 'on-failure') + if action == 'prompt': + msg = _('continue merge operation (yn)?' '$$ &Yes $$ &No') + if ui.promptchoice(msg, 0) == 1: + _haltmerge() + if action == 'halt': + _haltmerge() + # default action is 'continue', in which case we neither prompt nor halt + def _check(repo, r, ui, tool, fcd, files): fd = fcd.path() unused, unused, unused, back = files