help: do not abort topicmatch() because of unimportable extensions stable 4.4-rc
authorYuya Nishihara <yuya@tcha.org>
Sat, 05 Aug 2017 23:15:37 +0900
branchstable
changeset 34912 1e2454b60e59
parent 34911 645b6684cf5b
child 34913 8d9ba492e807
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.
mercurial/help.py
--- a/mercurial/help.py	Fri Oct 20 22:25:09 2017 +0900
+++ b/mercurial/help.py	Sat Aug 05 23:15:37 2017 +0900
@@ -158,11 +158,15 @@
         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('^')