Mercurial > hg-stable
changeset 29910:41491cf936f2
revset: add public function to create matcher from evaluatable tree
"hg debugrevspec" will use it to evaluate unoptimized tree.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 21 Aug 2016 11:37:00 +0900 |
parents | 371c2a39eead |
children | 4fb4fc331699 |
files | mercurial/revset.py |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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)