Patchwork D4121: resolve: correct behavior of mark-check=none to match docs

login
register
mail settings
Submitter phabricator
Date Aug. 5, 2018, 1:05 p.m.
Message ID <703194a0277ac4ffcad6e274e0feca46@localhost.localdomain>
Download mbox | patch
Permalink /patch/33272/
State Not Applicable
Headers show

Comments

phabricator - Aug. 5, 2018, 1:05 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7e75777e4a51: resolve: correct behavior of mark-check=none to match docs (authored by spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4121?vs=9927&id=9935

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/configitems.py
  tests/test-resolve.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -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 ..
 
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -194,7 +194,7 @@ 
     default=False,
 )
 coreconfigitem('commands', 'resolve.mark-check',
-    default=None,
+    default='none',
 )
 coreconfigitem('commands', 'show.aliasprefix',
     default=list,
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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