# HG changeset patch # User Yuya Nishihara # Date 1471747020 -32400 # Node ID 41491cf936f2e38d625305aef3851a2bcb617de6 # Parent 371c2a39eead4a8dc044c672dea17b3a5053a470 revset: add public function to create matcher from evaluatable tree "hg debugrevspec" will use it to evaluate unoptimized tree. diff -r 371c2a39eead -r 41491cf936f2 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)