##// END OF EJS Templates
parser: extract helper that creates a dict of aliases...
Yuya Nishihara -
r28893:ee11167f default
parent child Browse files
Show More
@@ -462,3 +462,13 b' class basealiasrules(object):'
462 if err:
462 if err:
463 err = efmt % {'section': cls._section, 'name': name, 'error': err}
463 err = efmt % {'section': cls._section, 'name': name, 'error': err}
464 return alias(name, tree, args, err, repl)
464 return alias(name, tree, args, err, repl)
465
466 @classmethod
467 def buildmap(cls, items):
468 """Parse a list of alias (name, replacement) pairs into a dict of
469 alias objects"""
470 aliases = {}
471 for decl, defn in items:
472 a = cls.build(decl, defn)
473 aliases[a.name] = a
474 return aliases
@@ -2320,10 +2320,7 b' def _expandaliases(aliases, tree, expand'
2320 return result
2320 return result
2321
2321
2322 def findaliases(ui, tree, showwarning=None):
2322 def findaliases(ui, tree, showwarning=None):
2323 aliases = {}
2323 aliases = _aliasrules.buildmap(ui.configitems('revsetalias'))
2324 for k, v in ui.configitems('revsetalias'):
2325 alias = _aliasrules.build(k, v)
2326 aliases[alias.name] = alias
2327 tree = _expandaliases(aliases, tree, [], {})
2324 tree = _expandaliases(aliases, tree, [], {})
2328 if showwarning:
2325 if showwarning:
2329 # warn about problematic (but not referred) aliases
2326 # warn about problematic (but not referred) aliases
General Comments 0
You need to be logged in to leave comments. Login now