[PATCH] manifest: avoid intersectfiles for matches > 100 files

Durham Goode durham at fb.com
Wed Mar 18 23:07:26 UTC 2015


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1426719585 25200
#      Wed Mar 18 15:59:45 2015 -0700
# Node ID c22eaf00a52f752fc8a776b822549de9f71495a9
# Parent  cdc4f3af2497b7342a8e4a081d2b07c9d888235a
manifest: avoid intersectfiles for matches > 100 files

Previously we only avoid manifest.intersectfiles for exact matches with less
than 100 files. We did not avoid it for non-exact matches. Let's just avoid
intersectfiles for all matches of > 100 files since the performance can be quite
rough with the new lazy manifest.

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -164,8 +164,8 @@ class manifestdict(object):
             return self.copy()
 
         files = match.files()
-        if ((match.matchfn == match.exact and len(files) < 100) or
-            (not match.anypats() and util.all(fn in self for fn in files))):
+        if (len(files) < 100 and (match.matchfn == match.exact or
+            (not match.anypats() and util.all(fn in self for fn in files)))):
             return self.intersectfiles(files)
 
         lm = manifestdict('')


More information about the Mercurial-devel mailing list