[PATCH V2] match: inverse _anypats(), making it _prefix()

Yuya Nishihara yuya at tcha.org
Thu Jul 13 12:04:38 EDT 2017


On Tue, 11 Jul 2017 09:44:28 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1499791352 25200
> #      Tue Jul 11 09:42:32 2017 -0700
> # Node ID 2800fa259f4e1c23dc9c9605ed02f4d734dd1761
> # Parent  32331f54930cebd2baf953506971953a588491b4
> match: inverse _anypats(), making it _prefix()

Queued, thanks.

> -def _anypats(kindpats):
> +def _prefix(kindpats):
> +    '''Whether all the patterns match a prefix (i.e. recursively)'''
>      for kind, pat, source in kindpats:
> -        if kind in ('glob', 're', 'relglob', 'relre', 'set', 'rootfilesin'):
> -            return True
> +        if kind not in ('path', 'relpath'):
> +            return False

So previously, 'subinclude' wasn't taken as anypats, which was wrong. Correct
me if I'm wrong.


More information about the Mercurial-devel mailing list