revset: add public function to create matcher from evaluatable tree
"hg debugrevspec" will use it to evaluate unoptimized tree.
--- 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)