changeset 7125:4a1ac535be1d

show enabled extensions in hg help
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sat, 18 Oct 2008 16:50:03 +0200
parents 63579aa36c8e
children 111813de4188
files mercurial/commands.py tests/test-extension.out tests/test-keyword.out tests/test-mq.out tests/test-qrecord.out
diffstat 5 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Oct 18 16:09:07 2008 +0200
+++ b/mercurial/commands.py	Sat Oct 18 16:50:03 2008 +0200
@@ -1335,6 +1335,19 @@
             else:
                 ui.write(' %-*s   %s\n' % (m, f, h[f]))
 
+        exts = list(extensions.extensions())
+        if exts:
+            ui.write(_('\nenabled extensions:\n\n'))
+            maxlength = 0
+            exthelps = []
+            for ename, ext in exts:
+                doc = (ext.__doc__ or _('(no help text available)'))
+                ename = ename.split('.')[-1]
+                maxlength = max(len(ename), maxlength)
+                exthelps.append((ename, doc.splitlines(0)[0].strip()))
+            for ename, text in exthelps:
+                ui.write(_(' %s   %s\n') % (ename.ljust(maxlength), text))
+
         if not ui.quiet:
             addglobalopts(True)
 
--- a/tests/test-extension.out	Sat Oct 18 16:09:07 2008 +0200
+++ b/tests/test-extension.out	Sat Oct 18 16:50:03 2008 +0200
@@ -33,6 +33,10 @@
  debugfoobar:
       yet another debug command
 
+enabled extensions:
+
+ debugextension   only debugcommands
+
 special help topics:
  dates             Date Formats
  patterns          File Name Patterns
--- a/tests/test-keyword.out	Sat Oct 18 16:09:07 2008 +0200
+++ b/tests/test-keyword.out	Sat Oct 18 16:50:03 2008 +0200
@@ -51,6 +51,12 @@
  kwfiles    print files currently configured for keyword expansion
  kwshrink   revert expanded keywords in working directory
 
+enabled extensions:
+
+ keyword   keyword expansion in local repositories
+ mq        patch management and development
+ notify    (no help text available)
+
 use "hg -v help keyword" to show aliases and global options
 % hg kwdemo
 [extensions]
--- a/tests/test-mq.out	Sat Oct 18 16:09:07 2008 +0200
+++ b/tests/test-mq.out	Sat Oct 18 16:50:03 2008 +0200
@@ -51,6 +51,10 @@
  qunapplied   print the patches not yet applied
  strip        strip a revision and all its descendants from the repository
 
+enabled extensions:
+
+ mq   patch management and development
+
 use "hg -v help mq" to show aliases and global options
 adding a
 updating working directory
--- a/tests/test-qrecord.out	Sat Oct 18 16:09:07 2008 +0200
+++ b/tests/test-qrecord.out	Sat Oct 18 16:50:03 2008 +0200
@@ -21,6 +21,10 @@
  status     show changed files in the working directory
  update     update working directory
 
+enabled extensions:
+
+ record   interactive change selection during commit or qrefresh
+
 use "hg help" for the full list of commands or "hg -v" for details
 % help (mq present)
 hg qrecord [OPTION]... PATCH [FILE]...