# HG changeset patch # User Yuya Nishihara # Date 1525339322 -32400 # Node ID 6e526b0961a861d0a7a07a12e9cbdcca8818d9fc # Parent b45f4c1532c00331c57233940696e75906c141e5 help: load module doc of disabled extension in extensions.disabledcmd() This helps rewriting _finddisablecmd() to not load the module. diff -r b45f4c1532c0 -r 6e526b0961a8 mercurial/extensions.py --- a/mercurial/extensions.py Thu May 03 18:15:43 2018 +0900 +++ b/mercurial/extensions.py Thu May 03 18:22:02 2018 +0900 @@ -675,11 +675,12 @@ break else: cmd = aliases[0] - return (cmd, name, mod) + doc = gettext(pycompat.getdoc(mod)) + return (cmd, name, doc) def disabledcmd(ui, cmd, strict=False): '''import disabled extensions until cmd is found. - returns (cmdname, extname, module)''' + returns (cmdname, extname, doc)''' paths = _disabledpaths(strip_init=True) if not paths: diff -r b45f4c1532c0 -r 6e526b0961a8 mercurial/help.py --- a/mercurial/help.py Thu May 03 18:15:43 2018 +0900 +++ b/mercurial/help.py Thu May 03 18:22:02 2018 +0900 @@ -574,9 +574,9 @@ return rst def helpextcmd(name, subtopic=None): - cmd, ext, mod = extensions.disabledcmd(ui, name, + cmd, ext, doc = extensions.disabledcmd(ui, name, ui.configbool('ui', 'strict')) - doc = gettext(pycompat.getdoc(mod)).splitlines()[0] + doc = doc.splitlines()[0] rst = listexts(_("'%s' is provided by the following " "extension:") % cmd, {ext: doc}, indent=4,