[PATCH 3 of 4] match: inverse _anypats(), making it _prefix()
Martin von Zweigbergk
martinvonz at google.com
Tue Jul 11 09:38:15 EDT 2017
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.
> + if kind not in ('path', 'relpath'):
> + return False
> + return True
Other than that, this patch looks good to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170711/6fb8b021/attachment.html>
More information about the Mercurial-devel
mailing list