[PATCH 7 of 8] dirstate.walk: cache match.explicitdir and traversedir locally

Siddharth Agarwal sid0 at fb.com
Fri May 3 17:05:48 CDT 2013


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1367617168 25200
#      Fri May 03 14:39:28 2013 -0700
# Node ID f120b69e6479affa562116153a1e8db0ad2d23e3
# Parent  7865345801e07b35d16073bc82913919f986206f
dirstate.walk: cache match.explicitdir and traversedir locally

diff -r 7865345801e0 -r f120b69e6479 mercurial/dirstate.py
--- a/mercurial/dirstate.py	Sun Apr 28 21:29:32 2013 -0700
+++ b/mercurial/dirstate.py	Fri May 03 14:39:28 2013 -0700
@@ -561,6 +561,8 @@ class dirstate(object):
 
         matchfn = match.matchfn
         matchalways = match.always()
+        matchedir = match.explicitdir
+        matchtdir = match.traversedir
         badfn = match.bad
         dmap = self._map
         normpath = util.normpath
@@ -621,7 +623,7 @@ class dirstate(object):
                     if nf in dmap:
                         #file deleted on disk but still in dirstate
                         results[nf] = None
-                    match.explicitdir(nf)
+                    matchedir(nf)
                     if not dirignore(nf):
                         wadd(nf)
                 elif kind == regkind or kind == lnkkind:
@@ -637,7 +639,7 @@ class dirstate(object):
                     prefix = nf + "/"
                     for fn in dmap:
                         if fn.startswith(prefix):
-                            match.explicitdir(nf)
+                            matchedir(nf)
                             skipstep3 = False
                             break
                     else:
@@ -666,7 +668,7 @@ class dirstate(object):
                 if nf not in results:
                     if kind == dirkind:
                         if not ignore(nf):
-                            match.traversedir(nf)
+                            matchtdir(nf)
                             wadd(nf)
                         if nf in dmap and (matchalways or matchfn(nf)):
                             results[nf] = None


More information about the Mercurial-devel mailing list