--- a/mercurial/help.py Sun Jun 03 09:06:15 2012 +0200
+++ b/mercurial/help.py Sat Jun 02 11:22:33 2012 +0200
@@ -12,19 +12,18 @@
def listexts(header, exts, indent=1):
'''return a text listing of the given extensions'''
- if not exts:
- return ''
- maxlength = max(len(e) for e in exts)
- result = '\n%s\n\n' % header
- for name, desc in sorted(exts.iteritems()):
- result += '%s%-*s %s\n' % (' ' * indent, maxlength + 2,
- ':%s:' % name, desc)
- return result
+ rst = []
+ if exts:
+ rst.append('\n%s\n\n' % header)
+ for name, desc in sorted(exts.iteritems()):
+ rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
+ return rst
def extshelp():
- doc = loaddoc('extensions')()
- doc += listexts(_('enabled extensions:'), extensions.enabled())
- doc += listexts(_('disabled extensions:'), extensions.disabled())
+ rst = loaddoc('extensions')().splitlines(True)
+ rst.extend(listexts(_('enabled extensions:'), extensions.enabled()))
+ rst.extend(listexts(_('disabled extensions:'), extensions.disabled()))
+ doc = ''.join(rst)
return doc
def optrst(options, verbose):