Patchwork [2,of,2,V2] dirstate.status: limit list to interesting files when possible

login
register
mail settings
Submitter Siddharth Agarwal
Date May 13, 2013, 7:47 p.m.
Message ID <4ffc32769e7d083f9381.1368474452@dev1091.prn1.facebook.com>
Download mbox | patch
Permalink /patch/1620/
State Superseded, archived
Headers show

Comments

Siddharth Agarwal - May 13, 2013, 7:47 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1366751793 25200
#      Tue Apr 23 14:16:33 2013 -0700
# Node ID 4ffc32769e7d083f938104d1ae8b02c75cdb1726
# Parent  ed4040d92e56cd7a963f896f72bcf55922449171
dirstate.status: limit list to interesting files when possible

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -810,8 +810,13 @@ 
 
         lnkkind = stat.S_IFLNK
 
-        for fn, st in self.walk(match, subrepos, listunknown,
-                                listignored).iteritems():
+        # We can't only list interesting files when:
+        # - we're listing all clean files
+        # - match.traversedir does something, because match.traversedir should
+        #   be called for every dir in the working dir
+        interesting = not listclean and match.traversedir is None
+        for fn, st in self.walk(match, subrepos, listunknown, listignored,
+                                interesting=interesting).iteritems():
             if fn not in dmap:
                 if (listignored or mexact(fn)) and dirignore(fn):
                     if listignored: