[PATCH 08 of 19 STABLE] largefiles: performance improvement for bypass route choice

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Mon Feb 27 10:46:33 UTC 2012


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1330335216 -32400
# Branch stable
# Node ID 2456abdf233742c14519360bb30786f0741291d3
# Parent  55bfbb4eef293f558302b0b70e20e5789e911c1e
largefiles: performance improvement for bypass route choice

original implementation chooses 'performance boost' route, if there
are any entries with which specified pattern matches in lfdirstate,
because there was no easy way to examine whether it is related to
context or not for 'directory pattern'.

but this requires full scan of lfdirstate entries in the worst case.

so, this patch uses 'dirs()' newly added to dirstate to avoid full
scan of lfdirstate.

diff -r 55bfbb4eef29 -r 2456abdf2337 hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py	Mon Feb 27 18:33:36 2012 +0900
+++ b/hgext/largefiles/reposetup.py	Mon Feb 27 18:33:36 2012 +0900
@@ -120,8 +120,10 @@
                 # handle it -- thus gaining a big performance boost.
                 lfdirstate = lfutil.openlfdirstate(ui, self)
                 if match.files() and not match.anypats():
-                    for f in lfdirstate:
-                        if match(f):
+                    for f in match.files():
+                        if lfutil.isstandin(f):
+                            continue
+                        if f in lfdirstate or f in lfdirstate.dirs():
                             break
                     else:
                         return super(lfiles_repo, self).status(node1, node2,



More information about the Mercurial-devel mailing list