[PATCH] mergecopies: avoid slowdown from linkrev adjustment (issue4680)

Matt Mackall mpm at selenic.com
Tue May 26 08:02:02 CDT 2015


# HG changeset patch
# User Matt Mackall <mpm at selenic.com>
# Date 1432640718 18000
#      Tue May 26 06:45:18 2015 -0500
# Node ID df1801b693ae6647631ba1876608bd0a3d7fd879
# Parent  605b1d32c1c011d56233f28923ee5354fce7e426
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.

diff -r 605b1d32c1c0 -r df1801b693ae mercurial/copies.py
--- a/mercurial/copies.py	Sat May 23 15:55:04 2015 -0500
+++ 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:


More information about the Mercurial-devel mailing list