Patchwork [0,of,6] Bug 3769 - 760c0d67ce5e regressed rebase perf by 25%

login
register
mail settings
Submitter Matt Mackall
Date Jan. 20, 2013, 9:49 p.m.
Message ID <1358718566.5965.277.camel@calx>
Download mbox | patch
Permalink /patch/693/
State Accepted
Headers show

Comments

Matt Mackall - Jan. 20, 2013, 9:49 p.m.
On Sun, 2013-01-20 at 14:18 +0100, Mads Kiilerich wrote:
> This fix is perhaps a bit too big for stable, but it has the advantage of being
> steps in the right direction and not just workarounds.

Something like this is a good step for 2.6, and advances several of my
goals for merge and resolve. But I'd rather just do this for now, which
has passed a few test runs here:

Patch

diff -r 28aaa24dc36b mercurial/merge.py
--- a/mercurial/merge.py	Sat Jan 19 17:26:19 2013 -0600
+++ b/mercurial/merge.py	Sun Jan 20 15:39:08 2013 -0600
@@ -228,7 +228,10 @@ 
                 break
 
     # Compare manifests
-    for f, n in sorted(m1.iteritems()):
+    visit = m1.iteritems()
+    if repo.ui.debugflag:
+        visit = sorted(visit)
+    for f, n in visit:
         if partial and not partial(f):
             continue
         if f in m2:
@@ -274,7 +277,10 @@ 
             else:
                 act("other deleted", "r", f)
 
-    for f, n in sorted(m2.iteritems()):
+    visit = m2.iteritems()
+    if repo.ui.debugflag:
+        visit = sorted(visit)
+    for f, n in visit:
         if partial and not partial(f):
             continue
         if f in m1 or f in copied: # files already visited