changeset 27440:ff305ab2e0d7

log: speed up hg log <file|folder> This patch makes hg log <file|folder> faster by using changelog.readfiles instead of changelog.read. On our large repos for hg log <file|folder> -l5 operations that were taking: - ~8s I see a 25% improvement - ~15s, I see a 35% improvement For recently modified folder/file, the difference is negligible as we don't have to consider many revisions.
author Laurent Charignon <lcharignon@fb.com>
date Fri, 18 Dec 2015 12:54:45 -0800
parents ed003859f1d8
children f67c6d8cc606
files mercurial/revset.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Fri Dec 18 13:45:55 2015 -0800
+++ b/mercurial/revset.py	Fri Dec 18 12:54:45 2015 -0800
@@ -1166,13 +1166,13 @@
 
     # This directly read the changelog data as creating changectx for all
     # revisions is quite expensive.
-    getchangeset = repo.changelog.read
+    getfiles = repo.changelog.readfiles
     wdirrev = node.wdirrev
     def matches(x):
         if x == wdirrev:
             files = repo[x].files()
         else:
-            files = getchangeset(x)[3]
+            files = getfiles(x)
         for f in files:
             if m(f):
                 return True