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

Martin von Zweigbergk martinvonz at google.com
Thu Jul 13 12:09:28 EDT 2017


On Thu, Jul 13, 2017 at 9:04 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> 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.

Oh, sorry, I didn't even think about that. But yes, you're correct. I
didn't mean to sneak in a bug fix in this patch, but now that's it's
done, I guess it's not worth splitting it up.


More information about the Mercurial-devel mailing list