comparison mercurial/help.py @ 44659:843418dc0b1b

extensions: refactor function for obtaining disabled extension help The way this worked before was hgext.__index__ was consulted. This file appears to only be present on some Windows distributions. This file contains a dict mapping extension name to its summary line, not its full docstring. The problem with this is that code in the help system was calling this function to resolve help text. If hgext.__index__ was present, only the summary line would be displayed. If not, the full extension help would be printed. This commit changes the function to not use hgext.__index__ such that it always returns the full extension help text. As a result of this change, test-extension.t and test-qrecord.t now pass when run from environments that have an hgext.__index__. Differential Revision: https://phab.mercurial-scm.org/D8344
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 29 Mar 2020 14:22:07 -0700
parents a0ec05d93c8e
children 79f6f9fa18c1
comparison
equal deleted inserted replaced
44658:15aef805619d 44659:843418dc0b1b
964 try: 964 try:
965 mod = extensions.find(name) 965 mod = extensions.find(name)
966 doc = gettext(pycompat.getdoc(mod)) or _(b'no help text available') 966 doc = gettext(pycompat.getdoc(mod)) or _(b'no help text available')
967 except KeyError: 967 except KeyError:
968 mod = None 968 mod = None
969 doc = extensions.disabledext(name) 969 doc = extensions.disabled_help(name)
970 if not doc: 970 if not doc:
971 raise error.UnknownCommand(name) 971 raise error.UnknownCommand(name)
972 972
973 if b'\n' not in doc: 973 if b'\n' not in doc:
974 head, tail = doc, b"" 974 head, tail = doc, b""