changeset 1802:8a7a24b96697

speed up hg log --debug hg repo: before: real 0m6.998s user 0m6.952s sys 0m0.046s after: real 0m3.884s user 0m3.839s sys 0m0.042s
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 25 Feb 2006 13:44:40 +0100
parents 38e19b1d3de8
children 06e7447c7302
files mercurial/localrepo.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Feb 24 20:25:18 2006 +0100
+++ b/mercurial/localrepo.py	Sat Feb 25 13:44:40 2006 +0100
@@ -519,6 +519,12 @@
                     del mf[fn]
             return mf
 
+        if node1:
+            # read the manifest from node1 before the manifest from node2,
+            # so that we'll hit the manifest cache if we're going through
+            # all the revisions in parent->child order.
+            mf1 = mfmatches(node1)
+
         # are we comparing the working directory?
         if not node2:
             if not wlock:
@@ -557,8 +563,6 @@
             # flush lists from dirstate before comparing manifests
             modified, added = [], []
 
-            mf1 = mfmatches(node1)
-
             for fn in mf2:
                 if mf1.has_key(fn):
                     if mf1[fn] != mf2[fn] and (mf2[fn] != "" or fcmp(fn, mf1)):