changeset 4400:84cd52b48f94

merge: reorganize some hunks in findcopies
author Matt Mackall <mpm@selenic.com>
date Thu, 03 May 2007 17:24:43 -0500
parents 93652499bed3
children 249e2603324c
files mercurial/merge.py
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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]))