changeset 4888:f24191a5d45a

Merge with -stable
author Matt Mackall <mpm@selenic.com>
date Mon, 16 Jul 2007 17:30:34 -0500
parents 2f09df302f30 (current diff) 931f901ab811 (diff)
children 3b081f2a77b2
files
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Mon Jul 16 14:43:47 2007 -0700
+++ b/mercurial/merge.py	Mon Jul 16 17:30:34 2007 -0500
@@ -157,7 +157,7 @@
     fullcopy = {}
     diverge = {}
 
-    def checkcopies(c, man):
+    def checkcopies(c, man, aman):
         '''check possible copies for filectx c'''
         for of in findold(c):
             fullcopy[c.path()] = of # remember for dir rename detection
@@ -165,6 +165,10 @@
                 if of in ma:
                     diverge.setdefault(of, []).append(c.path())
                 continue
+            # if the original file is unchanged on the other branch,
+            # no merge needed
+            if man[of] == aman.get(of):
+                continue
             c2 = ctx(of, man[of])
             ca = c.ancestor(c2)
             if not ca: # unrelated?
@@ -186,10 +190,10 @@
     u2 = nonoverlap(m2, m1, ma)
 
     for f in u1:
-        checkcopies(ctx(f, m1[f]), m2)
+        checkcopies(ctx(f, m1[f]), m2, ma)
 
     for f in u2:
-        checkcopies(ctx(f, m2[f]), m1)
+        checkcopies(ctx(f, m2[f]), m1, ma)
 
     d2 = {}
     for of, fl in diverge.items():
@@ -197,7 +201,6 @@
             fo = list(fl)
             fo.remove(f)
             d2[f] = (of, fo)
-    #diverge = d2
 
     if not fullcopy or not repo.ui.configbool("merge", "followdirs", True):
         return copy, diverge