[PATCH 2 of 2 v2] match: making visitdir() deal with non-recursive entries

Yuya Nishihara yuya at tcha.org
Sat Feb 18 01:16:04 EST 2017


On Mon, 13 Feb 2017 17:05:24 -0800, Rodrigo Damazio Bovendorp via Mercurial-devel wrote:
> # HG changeset patch
> # User Rodrigo Damazio Bovendorp <rdamazio at google.com>
> # Date 1487034194 28800
> #      Mon Feb 13 17:03:14 2017 -0800
> # Node ID e90de197586d0749e64cef752613e6fe41d1c8e3
> # Parent  94264a6e6672c917d42518f7ae9322445868d067
> match: making visitdir() deal with non-recursive entries

> @@ -241,7 +250,7 @@
>              return 'all'
>          if dir in self._excluderoots:
>              return False
> -        if (self._includeroots and
> +        if ((self._includeroots or self._includedirs != set(['.'])) and
>              '.' not in self._includeroots and
>              dir not in self._includeroots and
>              dir not in self._includedirs and

Maybe we'll need to distinguish the explicitly-set 'rootfilesin:.' from
the default value. Since visitdir() is for optimization, this shouldn't be
a blocker, so queued.

> @@ -642,11 +650,48 @@
>                      break
>                  root.append(p)
>              r.append('/'.join(root) or '.')
> -        elif kind in ('relpath', 'path', 'rootfilesin'):
> +        elif kind in ('relpath', 'path'):
>              r.append(pat or '.')
> +        elif kind in ('rootfilesin'):
                        ^^^^^^^^^^^^^^^

Fixed this as well.


More information about the Mercurial-devel mailing list