[PATCH 3 of 3] revset: add public function to create matcher from evaluatable tree

Augie Fackler raf at durin42.com
Wed Sep 7 15:25:37 EDT 2016


On Wed, Sep 07, 2016 at 11:44:17PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1471747020 -32400
> #      Sun Aug 21 11:37:00 2016 +0900
> # Node ID 8e55b08612217849ba56dbb921db704073a8e193
> # Parent  eab0f0cbd818cc2bb325cac0e7d61483b63d5ae6
> revset: add public function to create matcher from evaluatable tree

Queued these, thanks

>
> "hg debugrevspec" will use it to evaluate unoptimized tree.
>
> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -2615,15 +2615,17 @@ def matchany(ui, specs, repo=None):
>          tree = parse(specs[0], lookup)
>      else:
>          tree = ('or',) + tuple(parse(s, lookup) for s in specs)
> -    return _makematcher(ui, tree, repo)
> -
> -def _makematcher(ui, tree, repo):
> +
>      if ui:
>          tree = expandaliases(ui, tree, showwarning=ui.warn)
>      tree = foldconcat(tree)
>      tree = analyze(tree)
>      tree = optimize(tree)
>      posttreebuilthook(tree, repo)
> +    return makematcher(tree)
> +
> +def makematcher(tree):
> +    """Create a matcher from an evaluatable tree"""
>      def mfunc(repo, subset=None):
>          if subset is None:
>              subset = fullreposet(repo)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list