changeset 19191:ab9de1e8fc36

dirstate.status: avoid full walks when possible
author Siddharth Agarwal <sid0@fb.com>
date Tue, 23 Apr 2013 14:16:33 -0700
parents b03952ee634d
children 1d08df65cd3c
files mercurial/dirstate.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Mon Apr 22 17:11:18 2013 -0700
+++ b/mercurial/dirstate.py	Tue Apr 23 14:16:33 2013 -0700
@@ -807,8 +807,13 @@
 
         lnkkind = stat.S_IFLNK
 
-        for fn, st in self.walk(match, subrepos, listunknown,
-                                listignored).iteritems():
+        # We need to do full walks when either
+        # - we're listing all clean files, or
+        # - match.traversedir does something, because match.traversedir should
+        #   be called for every dir in the working dir
+        full = listclean or match.traversedir is not None
+        for fn, st in self.walk(match, subrepos, listunknown, listignored,
+                                full=full).iteritems():
             if fn not in dmap:
                 if (listignored or mexact(fn)) and dirignore(fn):
                     if listignored: