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

Yuya Nishihara yuya at tcha.org
Wed Sep 7 10:44:17 EDT 2016


# 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

"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)


More information about the Mercurial-devel mailing list