Patchwork [2,of,2] help: filter extension commands

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 14, 2015, 6:05 a.m.
Message ID <229f8ec6ad99ae815db6.1450073113@waste.org>
Download mbox | patch
Permalink /patch/12031/
State Accepted
Commit dfab0afde928bce876bc0af99ca21d942d2b66bf
Headers show

Comments

timeless@mozdev.org - Dec. 14, 2015, 6:05 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450070995 0
#      Mon Dec 14 05:29:55 2015 +0000
# Node ID 229f8ec6ad99ae815db672c111b05922cb21c55b
# Parent  ab3fdce6469850a8815205d6f328e16ea3b3dde8
help: filter extension commands
Pierre-Yves David - Dec. 14, 2015, 10:57 a.m.
On 12/14/2015 06:05 AM, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1450070995 0
> #      Mon Dec 14 05:29:55 2015 +0000
> # Node ID 229f8ec6ad99ae815db672c111b05922cb21c55b
> # Parent  ab3fdce6469850a8815205d6f328e16ea3b3dde8
> help: filter extension commands

Can you clarify what this patch tries to achieve and why it is a good idea?
timeless - Dec. 14, 2015, 8:13 p.m.
Normally help hides debug commands from the list of commands, but
debug commands in extensions aren't hidden w/o this patch.

On Mon, Dec 14, 2015 at 5:57 AM, Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
>
>
> On 12/14/2015 06:05 AM, timeless wrote:
>>
>> # HG changeset patch
>> # User timeless <timeless@mozdev.org>
>> # Date 1450070995 0
>> #      Mon Dec 14 05:29:55 2015 +0000
>> # Node ID 229f8ec6ad99ae815db672c111b05922cb21c55b
>> # Parent  ab3fdce6469850a8815205d6f328e16ea3b3dde8
>> help: filter extension commands
>
>
> Can you clarify what this patch tries to achieve and why it is a good idea?
>
> --
> Pierre-Yves David
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
Matt Mackall - Dec. 16, 2015, 11:24 p.m.
On Mon, 2015-12-14 at 00:05 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1450070995 0
> #      Mon Dec 14 05:29:55 2015 +0000
> # Node ID 229f8ec6ad99ae815db672c111b05922cb21c55b
> # Parent  ab3fdce6469850a8815205d6f328e16ea3b3dde8
> help: filter extension commands

Queued for default, thanks.

-- 
Mathematics is the supreme nostalgia of our time.

Patch

diff --git a/mercurial/help.py b/mercurial/help.py
--- a/mercurial/help.py
+++ b/mercurial/help.py
@@ -143,6 +143,8 @@ 
                     cmddoc = gettext(entry[0].__doc__).splitlines()[0]
                 else:
                     cmddoc = _('(no help text available)')
+                if filtercmd(ui, cmdname, kw, cmddoc):
+                    continue
                 results['extensioncommands'].append((cmdname, cmddoc))
     return results
 
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1057,7 +1057,7 @@ 
   Commands:
   $ hg help -e|egrep '^[A-Z].*:|^ debug'
   Extensions:
-  $ hg help -k|egrep '^[A-Z].*:'
+  $ hg help -k|egrep '^[A-Z].*:|^ debug'
   Topics:
   Commands:
   Extensions: