comparison mercurial/extensions.py @ 37975:6e526b0961a8

help: load module doc of disabled extension in extensions.disabledcmd() This helps rewriting _finddisablecmd() to not load the module.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 03 May 2018 18:22:02 +0900
parents b45f4c1532c0
children 9d44c71bd892
comparison
equal deleted inserted replaced
37974:b45f4c1532c0 37975:6e526b0961a8
673 if c.startswith(cmd): 673 if c.startswith(cmd):
674 cmd = c 674 cmd = c
675 break 675 break
676 else: 676 else:
677 cmd = aliases[0] 677 cmd = aliases[0]
678 return (cmd, name, mod) 678 doc = gettext(pycompat.getdoc(mod))
679 return (cmd, name, doc)
679 680
680 def disabledcmd(ui, cmd, strict=False): 681 def disabledcmd(ui, cmd, strict=False):
681 '''import disabled extensions until cmd is found. 682 '''import disabled extensions until cmd is found.
682 returns (cmdname, extname, module)''' 683 returns (cmdname, extname, doc)'''
683 684
684 paths = _disabledpaths(strip_init=True) 685 paths = _disabledpaths(strip_init=True)
685 if not paths: 686 if not paths:
686 raise error.UnknownCommand(cmd) 687 raise error.UnknownCommand(cmd)
687 688