diff mercurial/dispatch.py @ 10021:0022f5c5459e

help: don't display bogus help messages for invalid aliases
author Brodie Rao <me+hg@dackz.net>
date Sat, 05 Dec 2009 23:26:27 -0500
parents 931d2c757627
children d6512b3e9ac0
line wrap: on
line diff
--- a/mercurial/dispatch.py	Sat Dec 05 23:16:09 2009 +0100
+++ b/mercurial/dispatch.py	Sat Dec 05 23:26:27 2009 -0500
@@ -177,6 +177,7 @@
         self.opts = []
         self.help = ''
         self.norepo = True
+        self.badalias = False
 
         try:
             cmdutil.findcmd(self.name, cmdtable, True)
@@ -189,6 +190,7 @@
                 ui.warn(_("no definition for alias '%s'\n") % self.name)
                 return 1
             self.fn = fn
+            self.badalias = True
 
             return
 
@@ -217,12 +219,14 @@
                             % (self.name, cmd))
                 return 1
             self.fn = fn
+            self.badalias = True
         except error.AmbiguousCommand:
             def fn(ui, *args):
                 ui.warn(_("alias '%s' resolves to ambiguous command '%s'\n") \
                             % (self.name, cmd))
                 return 1
             self.fn = fn
+            self.badalias = True
 
     def __call__(self, ui, *args, **opts):
         if self.shadows: