# HG changeset patch
# User Yuya Nishihara <y...@tcha.org>
# 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('^')
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to