# HG changeset patch # User Siddharth Agarwal # Date 1366751793 25200 # Node ID ab9de1e8fc36522bb52a00756a36ff64d74877ff # Parent b03952ee634de701b54a936830d6cac7ccac7e50 dirstate.status: avoid full walks when possible diff -r b03952ee634d -r ab9de1e8fc36 mercurial/dirstate.py --- 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: