From 896a6939aa03da841f5c2564f1472c34ee7c1a4d Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 21 Oct 2008 11:29:27 +0200 Subject: [PATCH] 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. --- mercurial/commands.py | 5 +++-- tests/test-extension.out | 7 ------- tests/test-globalopts.out | 16 ++++++++++++++++ tests/test-help.out | 16 ++++++++++++++++ tests/test-qrecord.out | 4 ---- 5 files changed, 35 insertions(+), 13 deletions(-) diff --git a/mercurial/commands.py b/mercurial/commands.py index afc6bb1ea4..37983f4dce 100644 --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1310,7 +1310,8 @@ def help_(ui, name=None, with_version=False): 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 @@ def help_(ui, name=None, with_version=False): 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 = [] diff --git a/tests/test-extension.out b/tests/test-extension.out index 9bc6974c50..4c90e9be33 100644 --- a/tests/test-extension.out +++ b/tests/test-extension.out @@ -37,13 +37,6 @@ enabled extensions: 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 diff --git a/tests/test-globalopts.out b/tests/test-globalopts.out index 1e1676be1d..1830d4c4c8 100644 --- a/tests/test-globalopts.out +++ b/tests/test-globalopts.out @@ -198,6 +198,14 @@ list of commands: 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 @@ list of commands: 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 diff --git a/tests/test-help.out b/tests/test-help.out index 02e89fc97d..7ea9f0796e 100644 --- a/tests/test-help.out +++ b/tests/test-help.out @@ -89,6 +89,14 @@ list of commands: 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 @@ use "hg -v help" to show aliases and global options 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 diff --git a/tests/test-qrecord.out b/tests/test-qrecord.out index 34c0a07de7..06015133e4 100644 --- a/tests/test-qrecord.out +++ b/tests/test-qrecord.out @@ -21,10 +21,6 @@ basic commands: 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]...