Merge with mpm
authorBrendan Cully <brendan@kublai.com>
Fri, 13 Oct 2006 00:26:46 -0700
changeset 3379 fef022f9a238
parent 3378 1106e00e6847 (current diff)
parent 3371 8c36b33a27c7 (diff)
child 3381 bb9852b3bf06
Merge with mpm
--- a/mercurial/merge.py	Thu Oct 12 16:34:32 2006 -0700
+++ b/mercurial/merge.py	Fri Oct 13 00:26:46 2006 -0700
@@ -87,12 +87,12 @@
 
     return action
 
-def nonoverlap(d1, d2):
-    "Return list of elements in d1 not in d2"
+def nonoverlap(d1, d2, d3):
+    "Return list of elements in d1 not in d2 or d3"
 
     l = []
     for d in d1:
-        if d not in d2:
+        if d not in d3 and d not in d2:
             l.append(d)
 
     l.sort()
@@ -116,12 +116,12 @@
     old.sort()
     return old
 
-def findcopies(repo, m1, m2, limit):
+def findcopies(repo, m1, m2, ma, limit):
     """
     Find moves and copies between m1 and m2 back to limit linkrev
     """
 
-    if not repo.ui.config("merge", "followcopies"):
+    if not repo.ui.configbool("merge", "followcopies", True):
         return {}
 
     # avoid silly behavior for update from empty dir
@@ -131,8 +131,8 @@
     dcopies = repo.dirstate.copies()
     copy = {}
     match = {}
-    u1 = nonoverlap(m1, m2)
-    u2 = nonoverlap(m2, m1)
+    u1 = nonoverlap(m1, m2, ma)
+    u2 = nonoverlap(m2, m1, ma)
     ctx = util.cachefunc(lambda f,n: repo.filectx(f, fileid=n[:20]))
 
     def checkpair(c, f2, man):
@@ -194,7 +194,7 @@
         action.append((f, m) + args)
 
     if not (backwards or overwrite):
-        copy = findcopies(repo, m1, m2, pa.rev())
+        copy = findcopies(repo, m1, m2, ma, pa.rev())
 
     # Compare manifests
     for f, n in m1.iteritems():