On Sun, 09 Jul 2017 23:44:43 -0700, Martin von Zweigbergk via Mercurial-devel 
wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinv...@google.com>
> # Date 1499667389 25200
> #      Sun Jul 09 23:16:29 2017 -0700
> # Node ID 42df87114da18c9fcd52bcee2f7ab42e3ce76f63
> # Parent  3d7c440a43018d9a4b8c181131de86b57c50d2ce
> match: also optimize "path:." to use alwaysmatcher
> 
> The default pattern type from the command line is "relpath:". It's
> probably rare, but if the user explicitly types "path:." instead of
> just "." (or "relpath:."), let's allow for the same fast paths (which
> is the main benefit of using an alwaysmatcher).
> 
> diff --git a/mercurial/match.py b/mercurial/match.py
> --- a/mercurial/match.py
> +++ b/mercurial/match.py
> @@ -81,7 +81,7 @@
>      'relpath:.' does.
>      """
>      for kind, pat, source in kindpats:
> -        if pat != '' or kind not in ['relpath', 'glob']:
> +        if pat != '' or kind not in ['path', 'relpath', 'glob']:
>              return False
>      return True

As you said, 'path:' is normalized to pat='.', and pat isn't yet compiled
into an empty regexp pattern.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to