# HG changeset patch # User Laurent Charignon # Date 1427232295 25200 # Node ID dd5e56f08d13d9147d9f0f69c423432460ae5e79 # Parent c2c1ce5e6db169f77b892c1aa2620bfb554d924f revset: add hook after tree parsing This will be useful to execute actions after the tree is parsed and before the revset returns a match. Finding symbols in the parse tree will later allow hashes of hidden revisions to work on the command line without the --hidden flag. diff -r c2c1ce5e6db1 -r dd5e56f08d13 mercurial/revset.py --- a/mercurial/revset.py Mon Mar 30 14:58:42 2015 -0400 +++ b/mercurial/revset.py Tue Mar 24 14:24:55 2015 -0700 @@ -2493,6 +2493,10 @@ p = parser.parser(tokenize, elements) return p.parse(spec, lookup=lookup) +def posttreebuilthook(tree, repo): + # hook for extensions to execute code on the optimized tree + pass + def match(ui, spec, repo=None): if not spec: raise error.ParseError(_("empty query")) @@ -2506,6 +2510,7 @@ tree = findaliases(ui, tree, showwarning=ui.warn) tree = foldconcat(tree) weight, tree = optimize(tree, True) + posttreebuilthook(tree, repo) def mfunc(repo, subset=None): if subset is None: subset = fullreposet(repo)