mercurial/revset.py
changeset 37673 0c6b1ec75b73
parent 37389 bef863a09acd
child 37674 f83cb91b052e
equal deleted inserted replaced
37672:8bacc09814ba 37673:0c6b1ec75b73
  2164     "ancestor": ancestorspec,
  2164     "ancestor": ancestorspec,
  2165     "parent": parentspec,
  2165     "parent": parentspec,
  2166     "parentpost": parentpost,
  2166     "parentpost": parentpost,
  2167 }
  2167 }
  2168 
  2168 
  2169 def posttreebuilthook(tree, repo):
       
  2170     # hook for extensions to execute code on the optimized tree
       
  2171     pass
       
  2172 
       
  2173 def lookupfn(repo):
  2169 def lookupfn(repo):
  2174     return lambda symbol: scmutil.isrevsymbol(repo, symbol)
  2170     return lambda symbol: scmutil.isrevsymbol(repo, symbol)
  2175 
  2171 
  2176 def match(ui, spec, repo=None):
  2172 def match(ui, spec, repo=None):
  2177     """Create a matcher for a single revision spec"""
  2173     """Create a matcher for a single revision spec"""
  2209     if aliases:
  2205     if aliases:
  2210         tree = revsetlang.expandaliases(tree, aliases, warn=warn)
  2206         tree = revsetlang.expandaliases(tree, aliases, warn=warn)
  2211     tree = revsetlang.foldconcat(tree)
  2207     tree = revsetlang.foldconcat(tree)
  2212     tree = revsetlang.analyze(tree)
  2208     tree = revsetlang.analyze(tree)
  2213     tree = revsetlang.optimize(tree)
  2209     tree = revsetlang.optimize(tree)
  2214     posttreebuilthook(tree, repo)
       
  2215     return makematcher(tree)
  2210     return makematcher(tree)
  2216 
  2211 
  2217 def makematcher(tree):
  2212 def makematcher(tree):
  2218     """Create a matcher from an evaluatable tree"""
  2213     """Create a matcher from an evaluatable tree"""
  2219     def mfunc(repo, subset=None, order=None):
  2214     def mfunc(repo, subset=None, order=None):