merge: introduce tool.check parameter
tool.check is a list of check options, and can be used in place of
tool.checkchanged and tool.checkconflicts:
Equivalences:
tool.checkchanged = yes
tool.checkconflicts = no
tool.check = changed
tool.checkchanged = no
tool.checkconflicts = yes
tool.check = conflicts
tool.checkchanged = yes
tool.checkconflicts = yes
tool.check = changed, conflicts
Add _toollist() wrapper for ui.configlist() to implement this consistently.
checkchanged and checkconflicts are still supported, but check is
preferred for implementing new check options.
--- a/doc/hgrc.5.txt Wed Apr 21 12:02:51 2010 -0500
+++ b/doc/hgrc.5.txt Mon May 10 11:04:56 2010 -0500
@@ -463,13 +463,19 @@
``symlink``
This tool can merge symlinks. Defaults to False, even if tool was
selected by file pattern match.
-``checkconflicts``
- Check whether there are conflicts even though the tool reported
- success.
+``check``
+ A list of merge success-checking options:
+
+ ``changed``
+ Ask whether merge was successful when the merged file shows no changes.
+ ``conflicts``
+ Check whether there are conflicts even though the tool reported success.
+
+``checkchanged``
+ True is equivalent to ``check = changed``.
Default: False
-``checkchanged``
- Check whether outputs were written even though the tool reported
- success.
+``checkconflicts``
+ True is equivalent to ``check = conflicts``.
Default: False
``fixeol``
Attempt to fix up EOL changes caused by the merge tool.
--- a/mercurial/filemerge.py Wed Apr 21 12:02:51 2010 -0500
+++ b/mercurial/filemerge.py Mon May 10 11:04:56 2010 -0500
@@ -16,6 +16,9 @@
def _toolbool(ui, tool, part, default=False):
return ui.configbool("merge-tools", tool + "." + part, default)
+def _toollist(ui, tool, part, default=[]):
+ return ui.configlist("merge-tools", tool + "." + part, default)
+
_internal = ['internal:' + s
for s in 'fail local other merge prompt dump'.split()]
@@ -223,11 +226,13 @@
lambda x: '"%s"' % util.localpath(replace[x.group()[1:]]), args)
r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env)
- if not r and _toolbool(ui, tool, "checkconflicts"):
+ if not r and (_toolbool(ui, tool, "checkconflicts") or
+ 'conflicts' in _toollist(ui, tool, "check")):
if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()):
r = 1
- if not r and _toolbool(ui, tool, "checkchanged"):
+ if not r and (_toolbool(ui, tool, "checkchanged") or
+ 'changed' in _toollist(ui, tool, "check")):
if filecmp.cmp(repo.wjoin(fd), back):
if ui.promptchoice(_(" output file %s appears unchanged\n"
"was merge successful (yn)?") % fd,