diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4546,10 +4546,15 @@ if not (all or pats or show or mark or unmark): raise error.Abort(_('no files or directories specified'), hint=('use --all to re-merge all unresolved files')) + if mark and confirm and not pats: if ui.promptchoice(_(b'mark all unresolved files as resolved (yn)?' b'$$ &Yes $$ &No')): raise error.Abort(_('user quit')) + if unmark and confirm and not pats: + if ui.promptchoice(_(b'mark all resolved files as unresolved (yn)?' + b'$$ &Yes $$ &No')): + raise error.Abort(_('user quit')) if show: ui.pager('resolve') diff --git a/tests/test-resolve.t b/tests/test-resolve.t --- a/tests/test-resolve.t +++ b/tests/test-resolve.t @@ -557,6 +557,35 @@ R emp2 R emp3 +Test that commands.resolve.confirm respect --unmark option (only when no patterns args are given): +=============================================================================================== + + $ hg resolve -u emp1 + + $ hg resolve -l + U emp1 + R emp2 + R emp3 + + $ hg resolve -u << EOF + > n + > EOF + mark all resolved files as unresolved (yn)? n + abort: user quit + [255] + + $ hg resolve -m << EOF + > y + > EOF + mark all unresolved files as resolved (yn)? y + (no more unresolved files) + continue: hg rebase --continue + + $ hg resolve -l + R emp1 + R emp2 + R emp3 + $ hg rebase --abort rebase aborted $ cd ..