Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/help.py @ 27151:7625f6387fc4
help: make listexts less confusing for deprecated exts
Return an empty array instead of a heading and no items
author | timeless <timeless@mozdev.org> |
---|---|
date | Mon, 30 Nov 2015 20:44:22 +0000 |
parents | 7a77ee434179 |
children | ac27b1b3be85 |
comparison
equal
deleted
inserted
replaced
27150:88aaddb1af88 | 27151:7625f6387fc4 |
---|---|
25 | 25 |
26 def listexts(header, exts, indent=1, showdeprecated=False): | 26 def listexts(header, exts, indent=1, showdeprecated=False): |
27 '''return a text listing of the given extensions''' | 27 '''return a text listing of the given extensions''' |
28 rst = [] | 28 rst = [] |
29 if exts: | 29 if exts: |
30 rst.append('\n%s\n\n' % header) | |
31 for name, desc in sorted(exts.iteritems()): | 30 for name, desc in sorted(exts.iteritems()): |
32 if not showdeprecated and any(w in desc for w in _exclkeywords): | 31 if not showdeprecated and any(w in desc for w in _exclkeywords): |
33 continue | 32 continue |
34 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc)) | 33 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc)) |
34 if rst: | |
35 rst.insert(0, '\n%s\n\n' % header) | |
35 return rst | 36 return rst |
36 | 37 |
37 def extshelp(ui): | 38 def extshelp(ui): |
38 rst = loaddoc('extensions')(ui).splitlines(True) | 39 rst = loaddoc('extensions')(ui).splitlines(True) |
39 rst.extend(listexts( | 40 rst.extend(listexts( |