comparison mercurial/revset.py @ 28898:8d398155bfda

revset: rename findaliases() to expandaliases() This function returns a full tree of alias expansion applied, which sounds different from what "findaliases" would do.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 29 Feb 2016 22:58:15 +0900
parents 4bf9ed7a260e
children 1203159c8928
comparison
equal deleted inserted replaced
28897:c1f254138f44 28898:8d398155bfda
2254 """Parsing and expansion rule set of revset aliases""" 2254 """Parsing and expansion rule set of revset aliases"""
2255 _section = _('revset alias') 2255 _section = _('revset alias')
2256 _parse = staticmethod(_parsealias) 2256 _parse = staticmethod(_parsealias)
2257 _getlist = staticmethod(getlist) 2257 _getlist = staticmethod(getlist)
2258 2258
2259 def findaliases(ui, tree, showwarning=None): 2259 def expandaliases(ui, tree, showwarning=None):
2260 aliases = _aliasrules.buildmap(ui.configitems('revsetalias')) 2260 aliases = _aliasrules.buildmap(ui.configitems('revsetalias'))
2261 tree = _aliasrules.expand(aliases, tree) 2261 tree = _aliasrules.expand(aliases, tree)
2262 if showwarning: 2262 if showwarning:
2263 # warn about problematic (but not referred) aliases 2263 # warn about problematic (but not referred) aliases
2264 for name, alias in sorted(aliases.iteritems()): 2264 for name, alias in sorted(aliases.iteritems()):
2326 tree = ('or',) + tuple(parse(s, lookup) for s in specs) 2326 tree = ('or',) + tuple(parse(s, lookup) for s in specs)
2327 return _makematcher(ui, tree, repo) 2327 return _makematcher(ui, tree, repo)
2328 2328
2329 def _makematcher(ui, tree, repo): 2329 def _makematcher(ui, tree, repo):
2330 if ui: 2330 if ui:
2331 tree = findaliases(ui, tree, showwarning=ui.warn) 2331 tree = expandaliases(ui, tree, showwarning=ui.warn)
2332 tree = foldconcat(tree) 2332 tree = foldconcat(tree)
2333 weight, tree = optimize(tree, True) 2333 weight, tree = optimize(tree, True)
2334 posttreebuilthook(tree, repo) 2334 posttreebuilthook(tree, repo)
2335 def mfunc(repo, subset=None): 2335 def mfunc(repo, subset=None):
2336 if subset is None: 2336 if subset is None: