changeset 18812:1c40526da52a

dirstate.walk: remove subrepo and .hg from results before step 3 An upcoming patch will speed dirstate.walk up by not querying the results dict when it is empty. This ensures it is in some common cases. This should be safe because subrepos and .hg aren't part of the dirstate.
author Siddharth Agarwal <sid0@fb.com>
date Mon, 25 Mar 2013 14:12:39 -0700
parents 0377352eb7d3
children d780c472463c
files mercurial/dirstate.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Mon Mar 25 12:12:41 2013 -0500
+++ b/mercurial/dirstate.py	Mon Mar 25 14:12:39 2013 -0700
@@ -698,6 +698,10 @@
                     elif nf in dmap and matchfn(nf):
                         results[nf] = None
 
+        for s in subrepos:
+            del results[s]
+        del results['.hg']
+
         # step 3: report unseen items in the dmap hash
         if not skipstep3 and not exact:
             visit = sorted([f for f in dmap if f not in results and matchfn(f)])
@@ -725,9 +729,6 @@
                 nf = iter(visit).next
                 for st in util.statfiles([join(i) for i in visit]):
                     results[nf()] = st
-        for s in subrepos:
-            del results[s]
-        del results['.hg']
         return results
 
     def status(self, match, subrepos, ignored, clean, unknown):