diff mercurial/commands.py @ 38859:db03e5cefc82

resolve: support commands.resolve.confirm option with --mark flag Now, commands.resolve.confirm config option also respect --mark; and confirm to mark all 'unresolved' files as 'resolved'. It will confirm only when you don't pass any pats i.e 'hg resolve -m', because when no file pats are passed then --mark's default functionality is to mark all unresolved files. And if user has given file pats then I think there is no need to confirm. Differential Revision: https://phab.mercurial-scm.org/D4101
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Sat, 04 Aug 2018 12:23:18 +0530
parents 96d0795bd0bd
children 7e75777e4a51
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Aug 03 12:59:01 2018 -0700
+++ b/mercurial/commands.py	Sat Aug 04 12:23:18 2018 +0530
@@ -4546,6 +4546,10 @@
     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 show:
         ui.pager('resolve')