Mercurial > public > mercurial-scm > hg-stable
diff mercurial/help.py @ 16884:4fd1f1d7569b
help: fix 'hg help -k' matching an extension without docs
getattr is not needed, __doc__ always exists and defaults to None
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Thu, 07 Jun 2012 15:54:40 +0200 |
parents | 57a5ac98f9b7 |
children | 87882c8753d4 |
line wrap: on
line diff
--- a/mercurial/help.py Wed Jun 06 21:17:33 2012 -0500 +++ b/mercurial/help.py Thu Jun 07 15:54:40 2012 +0200 @@ -107,8 +107,11 @@ for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems(): if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])): cmdname = cmd.split('|')[0].lstrip('^') - cmddoc=getattr(mod, '__doc__', '').splitlines()[0] - results['extensioncommands'].append((cmdname, _(cmddoc))) + if mod.__doc__: + cmddoc = gettext(mod.__doc__).splitlines()[0] + else: + cmddoc = _('(no help text available)') + results['extensioncommands'].append((cmdname, cmddoc)) return results def loaddoc(topic):