diff mercurial/commands.py @ 38862:f8732e33bcbc

resolve: add confirm config option This config setting gives a functionality to confirm before it re-merge all unresolved files. If this config is enabled, when you run 'hg resolve --all' it will prompt with a msg "re-merge all unresolved files (yn)?" To enable this functionality: [commands] resolve.confirm = True Differential Revision: https://phab.mercurial-scm.org/D3988
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Tue, 31 Jul 2018 19:11:17 +0530
parents 6c8e3c847977
children 96d0795bd0bd
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Jul 17 23:34:55 2018 -0700
+++ b/mercurial/commands.py	Tue Jul 31 19:11:17 2018 +0530
@@ -4529,10 +4529,16 @@
     """
 
     opts = pycompat.byteskwargs(opts)
+    confirm = ui.configbool('commands', 'resolve.confirm')
     flaglist = 'all mark unmark list no_status'.split()
     all, mark, unmark, show, nostatus = \
         [opts.get(o) for o in flaglist]
 
+    if all and confirm:
+        if ui.promptchoice(_(b're-merge all unresolved files (yn)?'
+                             b'$$ &Yes $$ &No')):
+            raise error.Abort(_('user quit'))
+
     if (show and (mark or unmark)) or (mark and unmark):
         raise error.Abort(_("too many options specified"))
     if pats and all: