diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -808,18 +808,8 @@ def disabled(): return exts -def disabledext(name): - '''find a specific disabled extension from hgext. returns desc''' - try: - from hgext import __index__ # pytype: disable=import-error - - if name in _order: # enabled - return - else: - return gettext(__index__.docs.get(name)) - except (ImportError, AttributeError): - pass - +def disabled_help(name): + """Obtain the full help text for a disabled extension, or None.""" paths = _disabledpaths() if name in paths: return _disabledhelp(paths[name]) diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -966,7 +966,7 @@ def help_( doc = gettext(pycompat.getdoc(mod)) or _(b'no help text available') except KeyError: mod = None - doc = extensions.disabledext(name) + doc = extensions.disabled_help(name) if not doc: raise error.UnknownCommand(name) diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -695,7 +695,7 @@ def clone( # data. createopts[b'lfs'] = True - if extensions.disabledext(b'lfs'): + if extensions.disabled_help(b'lfs'): ui.status( _( b'(remote is using large file support (lfs), but it is '