changeset 7197:f60730693efc

help: show extension commands in short list, separate extension list in help In 'hg', we now show a short list of commands, including extension commands. In 'hg help', we show core commands, a list of enabled extensions, and topics.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Tue, 21 Oct 2008 11:29:27 +0200
parents 3f6a4f1de43f
children df79ee9b6278
files mercurial/commands.py tests/test-extension.out tests/test-globalopts.out tests/test-help.out tests/test-qrecord.out
diffstat 5 files changed, 35 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Oct 21 11:05:45 2008 +0200
+++ b/mercurial/commands.py	Tue Oct 21 11:29:27 2008 +0200
@@ -1310,7 +1310,8 @@
             f = c.split("|", 1)[0]
             if select and not select(f):
                 continue
-            if select is None and e[0].__module__ != __name__:
+            if (not select and name != 'shortlist' and
+                e[0].__module__ != __name__):
                 continue
             if name == "shortlist" and not f.startswith("^"):
                 continue
@@ -1338,7 +1339,7 @@
                 ui.write(' %-*s   %s\n' % (m, f, h[f]))
 
         exts = list(extensions.extensions())
-        if exts:
+        if exts and name != 'shortlist':
             ui.write(_('\nenabled extensions:\n\n'))
             maxlength = 0
             exthelps = []
--- a/tests/test-extension.out	Tue Oct 21 11:05:45 2008 +0200
+++ b/tests/test-extension.out	Tue Oct 21 11:29:27 2008 +0200
@@ -37,13 +37,6 @@
 
  debugextension   only debugcommands
 
-special help topics:
- dates             Date Formats
- patterns          File Name Patterns
- environment, env  Environment Variables
- revs, revisions   Specifying Single Revisions
- mrevs, multirevs  Specifying Multiple Revisions
-
 global options:
  -R --repository      repository root directory or symbolic path name
     --cwd             change working directory
--- a/tests/test-globalopts.out	Tue Oct 21 11:05:45 2008 +0200
+++ b/tests/test-globalopts.out	Tue Oct 21 11:29:27 2008 +0200
@@ -198,6 +198,14 @@
  verify       verify the integrity of the repository
  version      output version and copyright information
 
+special help topics:
+
+ dates        Date Formats
+ patterns     File Name Patterns
+ environment  Environment Variables
+ revisions    Specifying Single Revisions
+ multirevs    Specifying Multiple Revisions
+
 use "hg -v help" to show aliases and global options
 Mercurial Distributed SCM
 
@@ -252,5 +260,13 @@
  verify       verify the integrity of the repository
  version      output version and copyright information
 
+special help topics:
+
+ dates        Date Formats
+ patterns     File Name Patterns
+ environment  Environment Variables
+ revisions    Specifying Single Revisions
+ multirevs    Specifying Multiple Revisions
+
 use "hg -v help" to show aliases and global options
 %% not tested: --debugger
--- a/tests/test-help.out	Tue Oct 21 11:05:45 2008 +0200
+++ b/tests/test-help.out	Tue Oct 21 11:29:27 2008 +0200
@@ -89,6 +89,14 @@
  verify       verify the integrity of the repository
  version      output version and copyright information
 
+special help topics:
+
+ dates        Date Formats
+ patterns     File Name Patterns
+ environment  Environment Variables
+ revisions    Specifying Single Revisions
+ multirevs    Specifying Multiple Revisions
+
 use "hg -v help" to show aliases and global options
  add          add the specified files on the next commit
  addremove    add all new files, delete all missing files
@@ -138,6 +146,14 @@
  update       update working directory
  verify       verify the integrity of the repository
  version      output version and copyright information
+
+special help topics:
+
+ dates        Date Formats
+ patterns     File Name Patterns
+ environment  Environment Variables
+ revisions    Specifying Single Revisions
+ multirevs    Specifying Multiple Revisions
 hg add [OPTION]... [FILE]...
 
 add the specified files on the next commit
--- a/tests/test-qrecord.out	Tue Oct 21 11:05:45 2008 +0200
+++ b/tests/test-qrecord.out	Tue Oct 21 11:29:27 2008 +0200
@@ -21,10 +21,6 @@
  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]...