D4123: resolve: organize 'if confirm' conditionals

khanchi97 (Sushil khanchi) phabricator at mercurial-scm.org
Mon Aug 6 09:13:54 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG49b51f41fb46: resolve: organize 'if confirm' conditionals (authored by khanchi97, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4123?vs=9940&id=9976

REVISION DETAIL
  https://phab.mercurial-scm.org/D4123

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4534,27 +4534,27 @@
     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:
         raise error.Abort(_("can't specify --all and patterns"))
     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 confirm:
+        if all:
+            if ui.promptchoice(_(b're-merge all unresolved files (yn)?'
+                                 b'$$ &Yes $$ &No')):
+                raise error.Abort(_('user quit'))
+        if mark 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 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')



To: khanchi97, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list