Patchwork [2,of,2] dirstate.status: list interesting files whenever possible

login
register
mail settings
Submitter Siddharth Agarwal
Date May 10, 2013, 6:17 a.m.
Message ID <d162c44e829b4a889022.1368166663@dev1091.prn1.facebook.com>
Download mbox | patch
Permalink /patch/1606/
State Superseded, archived
Headers show

Comments

Siddharth Agarwal - May 10, 2013, 6:17 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1366751793 25200
#      Tue Apr 23 14:16:33 2013 -0700
# Node ID d162c44e829b4a889022f8752aa1e23e2e4070f2
# Parent  ed4040d92e56cd7a963f896f72bcf55922449171
dirstate.status: list interesting files whenever possible
Augie Fackler - May 12, 2013, 1:28 a.m.
On May 10, 2013, at 2:17 AM, Siddharth Agarwal <sid0@fb.com> wrote:

> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1366751793 25200
> #      Tue Apr 23 14:16:33 2013 -0700
> # Node ID d162c44e829b4a889022f8752aa1e23e2e4070f2
> # Parent  ed4040d92e56cd7a963f896f72bcf55922449171
> dirstate.status: list interesting files whenever possible

wording nit: limit list to interesting files when possible

(so it's clear that listing interesting files is less than everything, which wasn't obvious in my brain)

> 
> 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:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

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: