revset: add public function to create matcher from evaluatable tree
authorYuya Nishihara <yuya@tcha.org>
Sun, 21 Aug 2016 11:37:00 +0900
changeset 29906 41491cf936f2
parent 29905 371c2a39eead
child 29907 4fb4fc331699
revset: add public function to create matcher from evaluatable tree "hg debugrevspec" will use it to evaluate unoptimized tree.
mercurial/revset.py
--- a/mercurial/revset.py	Sun Aug 21 11:29:57 2016 +0900
+++ b/mercurial/revset.py	Sun Aug 21 11:37:00 2016 +0900
@@ -2615,15 +2615,17 @@
         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)