diff mercurial/filemerge.py @ 11148:a912f26777d3

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.
author David Champion <dgc@uchicago.edu>
date Mon, 10 May 2010 11:04:56 -0500
parents 523330d567cf
children d3c1eddfdbcf
line wrap: on
line diff
--- 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,