resolve: correct behavior of mark-check=none to match docs
Differential Revision: https://phab.mercurial-scm.org/D4121
--- 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 ..