From patchwork Fri Oct 20 13:24:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [STABLE] help: do not abort topicmatch() because of unimportable extensions From: Yuya Nishihara X-Patchwork-Id: 25261 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Fri, 20 Oct 2017 22:24:10 +0900 # HG changeset patch # User Yuya Nishihara # Date 1501942537 -32400 # Sat Aug 05 23:15:37 2017 +0900 # Branch stable # Node ID cd3e41ae547b07c03bd05ee0fef23ca27504383b # Parent 498697fe41f2ff08432743d62ee87f9c22630c81 help: do not abort topicmatch() because of unimportable extensions This is alternative workaround to D1198, originally spotted by the earlier version of the releasenotes extension. diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -158,11 +158,15 @@ def topicmatch(ui, commands, kw): extensions.disabled().iteritems()): if not docs: continue - mod = extensions.load(ui, name, '') name = name.rpartition('.')[-1] if lowercontains(name) or lowercontains(docs): # extension docs are already translated results['extensions'].append((name, docs.splitlines()[0])) + try: + mod = extensions.load(ui, name, '') + except ImportError: + # debug message would be printed in extensions.load() + continue for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems(): if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])): cmdname = cmd.partition('|')[0].lstrip('^')