Mercurial > public > mercurial-scm > hg-stable
diff mercurial/help.py @ 10364:de1e7099d100
dispatch: provide help for disabled extensions and commands
Before a command is declared unknown, each extension in hgext is searched,
starting with hgext.<cmdname>. If there's a matching command, a help message
suggests the appropriate extension and how to enable it.
Every extension could potentially be imported, but for cases like rebase,
relink, etc. only one extension is imported.
For the case of "hg help disabledext", if the extension is in hgext, the
extension description is read and a similar help suggestion is printed.
No extension import occurs.
author | Brodie Rao <me+hg@dackz.net> |
---|---|
date | Sun, 07 Feb 2010 14:01:43 +0100 |
parents | 08a0f04b56bd |
children | 61c52fedbd45 |
line wrap: on
line diff
--- a/mercurial/help.py Sun Feb 07 11:32:08 2010 +0100 +++ b/mercurial/help.py Sun Feb 07 14:01:43 2010 +0100 @@ -42,13 +42,14 @@ return ''.join(result) -def listexts(header, exts, maxlength): +def listexts(header, exts, maxlength, indent=1): '''return a text listing of the given extensions''' if not exts: return '' result = '\n%s\n\n' % header for name, desc in sorted(exts.iteritems()): - result += ' %-*s %s\n' % (maxlength + 2, ':%s:' % name, desc) + result += '%s%-*s %s\n' % (' ' * indent, maxlength + 2, + ':%s:' % name, desc) return result def extshelp():