Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/help.py @ 16942:87882c8753d4
help: fix extension commands help in keyword search
This patch fixes the synopsis shown for extension commands in keyword search
results. A previous patch erroneously caused the extension synopsis to be shown
instead.
Test cases for keyword search are missing, so I added a one.
author | Olav Reinert <seroton10@gmail.com> |
---|---|
date | Thu, 07 Jun 2012 01:42:50 +0200 |
parents | 4fd1f1d7569b |
children | 293dd81e4601 |
comparison
equal
deleted
inserted
replaced
16941:a1eb17bed550 | 16942:87882c8753d4 |
---|---|
105 # extension docs are already translated | 105 # extension docs are already translated |
106 results['extensions'].append((name, docs.splitlines()[0])) | 106 results['extensions'].append((name, docs.splitlines()[0])) |
107 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems(): | 107 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems(): |
108 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])): | 108 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])): |
109 cmdname = cmd.split('|')[0].lstrip('^') | 109 cmdname = cmd.split('|')[0].lstrip('^') |
110 if mod.__doc__: | 110 if entry[0].__doc__: |
111 cmddoc = gettext(mod.__doc__).splitlines()[0] | 111 cmddoc = gettext(entry[0].__doc__).splitlines()[0] |
112 else: | 112 else: |
113 cmddoc = _('(no help text available)') | 113 cmddoc = _('(no help text available)') |
114 results['extensioncommands'].append((cmdname, cmddoc)) | 114 results['extensioncommands'].append((cmdname, cmddoc)) |
115 return results | 115 return results |
116 | 116 |