[PATCH 3 of 4] match: inverse _anypats(), making it _prefix()

Yuya Nishihara yuya at tcha.org
Tue Jul 11 10:04:15 EDT 2017


On Tue, 11 Jul 2017 06:38:15 -0700, Martin von Zweigbergk wrote:
> On Jul 11, 2017 6:21 AM, "Yuya Nishihara" <yuya at tcha.org> wrote:
> 
> On Mon, 10 Jul 2017 10:27:43 -0700, Martin von Zweigbergk via
> Mercurial-devel wrote:
> > # HG changeset patch
> > # User Martin von Zweigbergk <martinvonz at google.com>
> > # Date 1499665323 25200
> > #      Sun Jul 09 22:42:03 2017 -0700
> > # Node ID b90074c6fa4739ae6b817d853ebcffd931671933
> > # Parent  25d89317826e99474cde4b97899903191ef1ba27
> > match: inverse _anypats(), making it _prefix()
> 
> > +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
> > +        assert kind not in ('listfile', 'listfile0', 'include',
> 'subinclude')
> 
> "subinclude" isn't expanded by normalize().
> 
> Good catch. Feel free to fix in flight. Otherwise I'll resend later today.

Can you send new version?

Perhaps it can be fixed by moving 'subinclude' to the "kind not in then False"
list, but I don't want to push a wrong patch with your name.


More information about the Mercurial-devel mailing list