mercurial/filemerge.py
changeset 26567 f18646cf0e93
parent 26529 7833b13b001f
child 26572 c7850af6bb75
--- a/mercurial/filemerge.py	Mon Oct 05 16:19:54 2015 -0700
+++ b/mercurial/filemerge.py	Wed Oct 07 21:22:16 2015 -0700
@@ -247,7 +247,7 @@
     files. It will fail if there are any conflicts and leave markers in
     the partially merged file. Markers will have two sections, one for each side
     of merge, unless mode equals 'union' which suppresses the markers."""
-    r = _premerge(repo, toolconf, files, labels=labels)
+    r = 1
     if r:
         a, b, c, back = files
 
@@ -349,7 +349,7 @@
     ``a.txt``, these files will accordingly be named ``a.txt.local``,
     ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
     same directory as ``a.txt``."""
-    r = _premerge(repo, toolconf, files, labels=labels)
+    r = 1
     if r:
         a, b, c, back = files
 
@@ -361,7 +361,7 @@
     return False, r
 
 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
-    r = _premerge(repo, toolconf, files, labels=labels)
+    r = 1
     if r:
         tool, toolpath, binary, symlink = toolconf
         a, b, c, back = files
@@ -519,8 +519,15 @@
         if markerstyle != 'basic':
             labels = _formatlabels(repo, fcd, fco, fca, labels)
 
-        needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf, files,
-                            labels=labels)
+        r = 1
+        if mergetype == fullmerge:
+            r = _premerge(repo, toolconf, files, labels=labels)
+
+        if not r:  # premerge successfully merged the file
+            needcheck = False
+        else:
+            needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf,
+                                files, labels=labels)
 
         if not needcheck:
             if r: