Patchwork dirstate.status: return explicit unknown files even when not asked

login
register
mail settings
Submitter Siddharth Agarwal
Date Oct. 14, 2013, 5:09 p.m.
Message ID <419788cc0e5e88947778.1381770572@sid0x220>
Download mbox | patch
Permalink /patch/2770/
State Accepted
Commit 601944f41257356ce6c02a616c5d9ca9a8facf6a
Headers show

Comments

Siddharth Agarwal - Oct. 14, 2013, 5:09 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1381724729 14400
#      Mon Oct 14 00:25:29 2013 -0400
# Node ID 419788cc0e5e889477786e4a4cae55b13819979a
# Parent  7bdb049b996a7d909adb945558dedaebe51f164e
dirstate.status: return explicit unknown files even when not asked

dirstate.walk will return unknown files that were explicitly requested, even
if listunknown is false. There's no point in dropping these files on the
floor in dirstate.status.

This has no effect on any current callers, because all of them assume the
unknown list is empty and ignore it. Future callers may find it useful,
though.
Augie Fackler - Oct. 16, 2013, 2:27 p.m.
On Mon, Oct 14, 2013 at 01:09:32PM -0400, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1381724729 14400
> #      Mon Oct 14 00:25:29 2013 -0400
> # Node ID 419788cc0e5e889477786e4a4cae55b13819979a
> # Parent  7bdb049b996a7d909adb945558dedaebe51f164e
> dirstate.status: return explicit unknown files even when not asked

Queued this, thanks.

>
> dirstate.walk will return unknown files that were explicitly requested, even
> if listunknown is false. There's no point in dropping these files on the
> floor in dirstate.status.
>
> This has no effect on any current callers, because all of them assume the
> unknown list is empty and ignore it. Future callers may find it useful,
> though.
>
> diff -r 7bdb049b996a -r 419788cc0e5e mercurial/dirstate.py
> --- a/mercurial/dirstate.py	Fri Sep 20 14:57:19 2013 -0700
> +++ b/mercurial/dirstate.py	Mon Oct 14 00:25:29 2013 -0400
> @@ -815,7 +815,7 @@ class dirstate(object):
>                  if (listignored or mexact(fn)) and dirignore(fn):
>                      if listignored:
>                          iadd(fn)
> -                elif listunknown:
> +                else:
>                      uadd(fn)
>                  continue
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff -r 7bdb049b996a -r 419788cc0e5e mercurial/dirstate.py
--- a/mercurial/dirstate.py	Fri Sep 20 14:57:19 2013 -0700
+++ b/mercurial/dirstate.py	Mon Oct 14 00:25:29 2013 -0400
@@ -815,7 +815,7 @@  class dirstate(object):
                 if (listignored or mexact(fn)) and dirignore(fn):
                     if listignored:
                         iadd(fn)
-                elif listunknown:
+                else:
                     uadd(fn)
                 continue