559 @staticmethod |
559 @staticmethod |
560 def _trygetfunc(tree): |
560 def _trygetfunc(tree): |
561 if tree[0] == 'func' and tree[1][0] == 'symbol': |
561 if tree[0] == 'func' and tree[1][0] == 'symbol': |
562 return tree[1][1], getlist(tree[2]) |
562 return tree[1][1], getlist(tree[2]) |
563 |
563 |
564 def expandaliases(ui, tree): |
564 def expandaliases(tree, aliases, warn=None): |
565 aliases = _aliasrules.buildmap(ui.configitems('revsetalias')) |
565 """Expand aliases in a tree, aliases is a list of (name, value) tuples""" |
|
566 aliases = _aliasrules.buildmap(aliases) |
566 tree = _aliasrules.expand(aliases, tree) |
567 tree = _aliasrules.expand(aliases, tree) |
567 # warn about problematic (but not referred) aliases |
568 # warn about problematic (but not referred) aliases |
568 for name, alias in sorted(aliases.iteritems()): |
569 if warn is not None: |
569 if alias.error and not alias.warned: |
570 for name, alias in sorted(aliases.iteritems()): |
570 ui.warn(_('warning: %s\n') % (alias.error)) |
571 if alias.error and not alias.warned: |
571 alias.warned = True |
572 warn(_('warning: %s\n') % (alias.error)) |
|
573 alias.warned = True |
572 return tree |
574 return tree |
573 |
575 |
574 def foldconcat(tree): |
576 def foldconcat(tree): |
575 """Fold elements to be concatenated by `##` |
577 """Fold elements to be concatenated by `##` |
576 """ |
578 """ |