changeset 22031:b36c60cfe46f

merge-tools: make premerge valid values extensible We want to introduce a version leaving merge3 style markers.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 04 Aug 2014 16:58:39 -0700
parents ecdff28d13e2
children d7f25834ffbb
files mercurial/filemerge.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/filemerge.py	Mon Aug 04 16:50:15 2014 -0700
+++ b/mercurial/filemerge.py	Mon Aug 04 16:58:39 2014 -0700
@@ -178,14 +178,15 @@
 
     ui = repo.ui
 
+    validkeep = ['keep']
+
     # do we attempt to simplemerge first?
     try:
         premerge = _toolbool(ui, tool, "premerge", not binary)
     except error.ConfigError:
         premerge = _toolstr(ui, tool, "premerge").lower()
-        valid = 'keep'.split()
-        if premerge not in valid:
-            _valid = ', '.join(["'" + v + "'" for v in valid])
+        if premerge not in validkeep:
+            _valid = ', '.join(["'" + v + "'" for v in validkeep])
             raise error.ConfigError(_("%s.premerge not valid "
                                       "('%s' is neither boolean nor %s)") %
                                     (tool, premerge, _valid))
@@ -195,7 +196,7 @@
         if not r:
             ui.debug(" premerge successful\n")
             return 0
-        if premerge != 'keep':
+        if premerge not in validkeep:
             util.copyfile(back, a) # restore from backup and try again
     return 1 # continue merging