changeset 4893:44b0031514c1

merge with main
author Thomas Arendsen Hein <thomas@intevation.de>
date Tue, 17 Jul 2007 08:22:43 +0200
parents d69b1fb111b9 (current diff) 3b081f2a77b2 (diff)
children ee04732fe61d
files
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Mon Jul 16 20:15:03 2007 -0700
+++ b/mercurial/context.py	Tue Jul 17 08:22:43 2007 +0200
@@ -184,7 +184,7 @@
     def __eq__(self, other):
         try:
             return (self._path == other._path
-                    and self._changeid == other._changeid)
+                    and self._fileid == other._fileid)
         except AttributeError:
             return False
 
--- a/mercurial/merge.py	Mon Jul 16 20:15:03 2007 -0700
+++ b/mercurial/merge.py	Tue Jul 17 08:22:43 2007 +0200
@@ -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