merge: reorganize some hunks in findcopies
authorMatt Mackall <mpm@selenic.com>
Thu, 03 May 2007 17:24:43 -0500
changeset 4400 84cd52b48f94
parent 4399 93652499bed3
child 4402 249e2603324c
merge: reorganize some hunks in findcopies
mercurial/merge.py
--- a/mercurial/merge.py	Thu May 03 17:24:43 2007 -0500
+++ b/mercurial/merge.py	Thu May 03 17:24:43 2007 -0500
@@ -102,6 +102,12 @@
     Find moves and copies between m1 and m2 back to limit linkrev
     """
 
+    def nonoverlap(d1, d2, d3):
+        "Return list of elements in d1 not in d2 or d3"
+        l = [d for d in d1 if d not in d3 and d not in d2]
+        l.sort()
+        return l
+
     def dirname(f):
         s = f.rfind("/")
         if s == -1:
@@ -139,11 +145,8 @@
         old.sort()
         return old
 
-    def nonoverlap(d1, d2, d3):
-        "Return list of elements in d1 not in d2 or d3"
-        l = [d for d in d1 if d not in d3 and d not in d2]
-        l.sort()
-        return l
+    copy = {}
+    fullcopy = {}
 
     def checkcopies(c, man):
         '''check possible copies for filectx c'''
@@ -169,8 +172,6 @@
         return {}
 
     dcopies = repo.dirstate.copies()
-    copy = {}
-    fullcopy = {}
     u1 = nonoverlap(m1, m2, ma)
     u2 = nonoverlap(m2, m1, ma)
     ctx = util.cachefunc(lambda f, n: repo.filectx(f, fileid=n[:20]))