diff mercurial/revset.py @ 29926:ae933e3e2226

revset: remove showwarning option from expandaliases() Now all callers pass showwarning=ui.warn, so we no longer need the option to suppress warnings.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 08 Sep 2016 22:44:10 +0900
parents 41491cf936f2
children b3845cab4ddc
line wrap: on
line diff
--- a/mercurial/revset.py	Sun Aug 21 12:45:43 2016 +0900
+++ b/mercurial/revset.py	Thu Sep 08 22:44:10 2016 +0900
@@ -2556,15 +2556,14 @@
         if tree[0] == 'func' and tree[1][0] == 'symbol':
             return tree[1][1], getlist(tree[2])
 
-def expandaliases(ui, tree, showwarning=None):
+def expandaliases(ui, tree):
     aliases = _aliasrules.buildmap(ui.configitems('revsetalias'))
     tree = _aliasrules.expand(aliases, tree)
-    if showwarning:
-        # warn about problematic (but not referred) aliases
-        for name, alias in sorted(aliases.iteritems()):
-            if alias.error and not alias.warned:
-                showwarning(_('warning: %s\n') % (alias.error))
-                alias.warned = True
+    # warn about problematic (but not referred) aliases
+    for name, alias in sorted(aliases.iteritems()):
+        if alias.error and not alias.warned:
+            ui.warn(_('warning: %s\n') % (alias.error))
+            alias.warned = True
     return tree
 
 def foldconcat(tree):
@@ -2617,7 +2616,7 @@
         tree = ('or',) + tuple(parse(s, lookup) for s in specs)
 
     if ui:
-        tree = expandaliases(ui, tree, showwarning=ui.warn)
+        tree = expandaliases(ui, tree)
     tree = foldconcat(tree)
     tree = analyze(tree)
     tree = optimize(tree)