changeset 38873:7e75777e4a51

resolve: correct behavior of mark-check=none to match docs Differential Revision: https://phab.mercurial-scm.org/D4121
author Kyle Lippincott <spectral@google.com>
date Sun, 05 Aug 2018 00:53:55 -0700
parents 576eef1ab43d
children f35f6791595f
files mercurial/commands.py mercurial/configitems.py tests/test-resolve.t
diffstat 3 files changed, 25 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Aug 02 14:57:20 2018 -0700
+++ b/mercurial/commands.py	Sun Aug 05 00:53:55 2018 -0700
@@ -4608,6 +4608,9 @@
         hasconflictmarkers = []
         if mark:
             markcheck = ui.config('commands', 'resolve.mark-check')
+            if markcheck not in ['warn', 'abort']:
+                # Treat all invalid / unrecognized values as 'none'.
+                markcheck = False
         for f in ms:
             if not m(f):
                 continue
--- a/mercurial/configitems.py	Thu Aug 02 14:57:20 2018 -0700
+++ b/mercurial/configitems.py	Sun Aug 05 00:53:55 2018 -0700
@@ -194,7 +194,7 @@
     default=False,
 )
 coreconfigitem('commands', 'resolve.mark-check',
-    default=None,
+    default='none',
 )
 coreconfigitem('commands', 'show.aliasprefix',
     default=list,
--- a/tests/test-resolve.t	Thu Aug 02 14:57:20 2018 -0700
+++ b/tests/test-resolve.t	Sun Aug 05 00:53:55 2018 -0700
@@ -400,6 +400,7 @@
   $ hg resolve -l
   R file1
   R file2
+Test option value 'warn'
   $ hg resolve --unmark
   $ hg resolve -l
   U file1
@@ -421,6 +422,26 @@
   $ hg resolve -l
   R file1
   R file2
+If the user passes an invalid value, we treat it as 'none'.
+  $ hg resolve --unmark
+  $ hg resolve -l
+  U file1
+  U file2
+  $ hg --config commands.resolve.mark-check=nope resolve -m
+  (no more unresolved files)
+  $ hg resolve -l
+  R file1
+  R file2
+Test explicitly setting the otion to 'none'
+  $ hg resolve --unmark
+  $ hg resolve -l
+  U file1
+  U file2
+  $ hg --config commands.resolve.mark-check=none resolve -m
+  (no more unresolved files)
+  $ hg resolve -l
+  R file1
+  R file2
 
   $ cd ..