alias: show one-line hint for command provided by disabled extension
authorYuya Nishihara <yuya@tcha.org>
Wed, 13 Aug 2014 22:18:28 +0900
changeset 22163 01ef4347e4ab
parent 22162 7ada34676db8
child 22164 efd65e51bc0b
alias: show one-line hint for command provided by disabled extension It will be a hint of Abort exception. "hg help <alias>" provides the detailed version as before.
mercurial/dispatch.py
tests/test-alias.t
--- a/mercurial/dispatch.py	Wed Aug 13 19:38:47 2014 +0900
+++ b/mercurial/dispatch.py	Wed Aug 13 22:18:28 2014 +0900
@@ -447,7 +447,9 @@
             if self.unknowncmd:
                 try:
                     # check if the command is in a disabled extension
-                    commands.help_(ui, self.cmdname, unknowncmd=True)
+                    cmd, ext = extensions.disabledcmd(ui, self.cmdname)[:2]
+                    ui.warn(_("'%s' is provided by '%s' extension\n")
+                            % (cmd, ext))
                 except error.UnknownCommand:
                     pass
             return -1
--- a/tests/test-alias.t	Wed Aug 13 19:38:47 2014 +0900
+++ b/tests/test-alias.t	Wed Aug 13 22:18:28 2014 +0900
@@ -90,11 +90,7 @@
 
   $ hg disabled
   alias 'disabled' resolves to unknown command 'email'
-  'email' is provided by the following extension:
-  
-      patchbomb     command to send changesets as (a series of) patch emails
-  
-  (use "hg help extensions" for information on enabling extensions)
+  'email' is provided by 'patchbomb' extension
   [255]
   $ hg help disabled
   alias 'disabled' resolves to unknown command 'email'