mercurial/dispatch.py
changeset 10364 de1e7099d100
parent 10282 08a0f04b56bd
child 10402 d216fa04e48a
--- a/mercurial/dispatch.py	Sun Feb 07 11:32:08 2010 +0100
+++ b/mercurial/dispatch.py	Sun Feb 07 14:01:43 2010 +0100
@@ -93,7 +93,12 @@
         ui.warn(_("killed!\n"))
     except error.UnknownCommand, inst:
         ui.warn(_("hg: unknown command '%s'\n") % inst.args[0])
-        commands.help_(ui, 'shortlist')
+        try:
+            # check if the command is in a disabled extension
+            # (but don't check for extensions themselves)
+            commands.help_(ui, inst.args[0], unknowncmd=True)
+        except error.UnknownCommand:
+            commands.help_(ui, 'shortlist')
     except util.Abort, inst:
         ui.warn(_("abort: %s\n") % inst)
     except ImportError, inst:
@@ -218,6 +223,11 @@
             def fn(ui, *args):
                 ui.warn(_("alias '%s' resolves to unknown command '%s'\n") \
                             % (self.name, cmd))
+                try:
+                    # check if the command is in a disabled extension
+                    commands.help_(ui, cmd, unknowncmd=True)
+                except error.UnknownCommand:
+                    pass
                 return 1
             self.fn = fn
             self.badalias = True