[PATCH] match: make subinclude construction lazy

Yuya Nishihara yuya at tcha.org
Wed May 3 23:51:28 EDT 2017


On Wed, 3 May 2017 10:34:10 -0700, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1493832657 25200
> #      Wed May 03 10:30:57 2017 -0700
> # Node ID 69fee32d094c234b30114977b0dcce1b45401f5a
> # Parent  6cacc271ee0a9385be483314dc73be176a13c891
> match: make subinclude construction lazy

Looks good. Queued, thanks.

> diff --git a/mercurial/match.py b/mercurial/match.py
> --- a/mercurial/match.py
> +++ b/mercurial/match.py
> @@ -64,12 +64,12 @@ def _expandsubinclude(kindpats, root):
>              path = pathutil.join(sourceroot, pat)
>  
>              newroot = pathutil.dirname(path)
> -            relmatcher = match(newroot, '', [], ['include:%s' % path])
> +            matcherargs = (newroot, '', [], ['include:%s' % path])
>  
>              prefix = pathutil.canonpath(root, root, newroot)
>              if prefix:
>                  prefix += '/'
> -            relmatchers.append((prefix, relmatcher))
> +            relmatchers.append((prefix, matcherargs))

I've updated the docstring as s/matchers/matcher args/.


More information about the Mercurial-devel mailing list