Patchwork [2,of,2] help: make help deprecated mention the extension

login
register
mail settings
Submitter timeless@mozdev.org
Date Nov. 30, 2015, 8:46 p.m.
Message ID <f593d38791c3cd7454c7.1448916377@waste.org>
Download mbox | patch
Permalink /patch/11685/
State Accepted
Headers show

Comments

timeless@mozdev.org - Nov. 30, 2015, 8:46 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1448916307 0
#      Mon Nov 30 20:45:07 2015 +0000
# Node ID f593d38791c3cd7454c704ca03284d71258bf2d3
# Parent  fa1770fa3f4097e2826e8d5f978a324a280ec7ac
help: make help deprecated mention the extension

before this, you got an empty list of extensions, which was unhelpful
Augie Fackler - Dec. 1, 2015, 3:02 p.m.
On Mon, Nov 30, 2015 at 02:46:17PM -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1448916307 0
> #      Mon Nov 30 20:45:07 2015 +0000
> # Node ID f593d38791c3cd7454c704ca03284d71258bf2d3
> # Parent  fa1770fa3f4097e2826e8d5f978a324a280ec7ac
> help: make help deprecated mention the extension

queued these, thanks

>
> before this, you got an empty list of extensions, which was unhelpful
>
> diff --git a/mercurial/help.py b/mercurial/help.py
> --- a/mercurial/help.py
> +++ b/mercurial/help.py
> @@ -474,7 +474,8 @@
>          doc = gettext(mod.__doc__).splitlines()[0]
>
>          rst = listexts(_("'%s' is provided by the following "
> -                              "extension:") % cmd, {ext: doc}, indent=4)
> +                              "extension:") % cmd, {ext: doc}, indent=4,
> +                       showdeprecated=True)
>          rst.append('\n')
>          rst.append(_('(use "hg help extensions" for information on enabling '
>                     'extensions)\n'))
> diff --git a/tests/test-extension.t b/tests/test-extension.t
> --- a/tests/test-extension.t
> +++ b/tests/test-extension.t
> @@ -367,6 +367,15 @@
>
>    $ echo 'debugextension = !' >> $HGRCPATH
>
> +Asking for help about a deprecated extension should do something useful:
> +
> +  $ hg help glog
> +  'glog' is provided by the following extension:
> +
> +      graphlog      command to view revision graphs from a shell (DEPRECATED)
> +
> +  (use "hg help extensions" for information on enabling extensions)
> +
>  Extension module help vs command help:
>
>    $ echo 'extdiff =' >> $HGRCPATH
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/help.py b/mercurial/help.py
--- a/mercurial/help.py
+++ b/mercurial/help.py
@@ -474,7 +474,8 @@ 
         doc = gettext(mod.__doc__).splitlines()[0]
 
         rst = listexts(_("'%s' is provided by the following "
-                              "extension:") % cmd, {ext: doc}, indent=4)
+                              "extension:") % cmd, {ext: doc}, indent=4,
+                       showdeprecated=True)
         rst.append('\n')
         rst.append(_('(use "hg help extensions" for information on enabling '
                    'extensions)\n'))
diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -367,6 +367,15 @@ 
 
   $ echo 'debugextension = !' >> $HGRCPATH
 
+Asking for help about a deprecated extension should do something useful:
+
+  $ hg help glog
+  'glog' is provided by the following extension:
+  
+      graphlog      command to view revision graphs from a shell (DEPRECATED)
+  
+  (use "hg help extensions" for information on enabling extensions)
+
 Extension module help vs command help:
 
   $ echo 'extdiff =' >> $HGRCPATH