Mercurial > public > mercurial-scm > hg
comparison mercurial/help.py @ 16855:57a5ac98f9b7
help: fix keyword search output for extension commands
This patch fixes the help keyword search "hg help -k" to show correct results
in the section listing extension commands.
author | Olav Reinert <seroton10@gmail.com> |
---|---|
date | Sun, 03 Jun 2012 17:49:04 +0200 |
parents | af69b2b64d6e |
children | 4fd1f1d7569b |
comparison
equal
deleted
inserted
replaced
16854:d71ada5a6a33 | 16855:57a5ac98f9b7 |
---|---|
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 results['extensioncommands'].append( | 110 cmddoc=getattr(mod, '__doc__', '').splitlines()[0] |
111 (cmdname, _(getattr(cmd, '__doc__', '')))) | 111 results['extensioncommands'].append((cmdname, _(cmddoc))) |
112 return results | 112 return results |
113 | 113 |
114 def loaddoc(topic): | 114 def loaddoc(topic): |
115 """Return a delayed loader for help/topic.txt.""" | 115 """Return a delayed loader for help/topic.txt.""" |
116 | 116 |