mergecopies: avoid slowdown from linkrev adjustment (issue4680) stable
authorMatt Mackall <mpm@selenic.com>
Tue, 26 May 2015 06:45:18 -0500
branchstable
changeset 25279 708b19c18adf
parent 25268 a973b050621d
child 25289 6ac860f700b5
child 25294 b1b89a0a606d
mergecopies: avoid slowdown from linkrev adjustment (issue4680) checkcopies was using fctx.rev() which it was expecting would be equivalent to linkrev() but was triggering the new _adjustlinkrev path. This was making grafts and merges with large sets of potential copies very expensive.
mercurial/copies.py
--- a/mercurial/copies.py	Mon May 25 01:26:23 2015 +0900
+++ b/mercurial/copies.py	Tue May 26 06:45:18 2015 -0500
@@ -456,7 +456,7 @@
 
         g1, g2 = f1.ancestors(), f2.ancestors()
         try:
-            f1r, f2r = f1.rev(), f2.rev()
+            f1r, f2r = f1.linkrev(), f2.linkrev()
 
             if f1r is None:
                 f1 = g1.next()
@@ -464,7 +464,7 @@
                 f2 = g2.next()
 
             while True:
-                f1r, f2r = f1.rev(), f2.rev()
+                f1r, f2r = f1.linkrev(), f2.linkrev()
                 if f1r > f2r:
                     f1 = g1.next()
                 elif f2r > f1r:
@@ -479,7 +479,7 @@
     of = None
     seen = set([f])
     for oc in ctx(f, m1[f]).ancestors():
-        ocr = oc.rev()
+        ocr = oc.linkrev()
         of = oc.path()
         if of in seen:
             # check limit late - grab last rename before