[PATCH] help: don't crash in keyword search if an extension fails to provide docs

Simon Farnsworth simonfar at fb.com
Wed Feb 10 10:54:59 UTC 2016


# HG changeset patch
# User Simon Farnsworth <simonfar at fb.com>
# Date 1455097738 28800
#      Wed Feb 10 01:48:58 2016 -0800
# Node ID ab0871393d3e0827645371b3d764c268c7ebde94
# Parent  a036e1ae1fbe88ab99cb861ebfc2e4da7a3912ca
help: don't crash in keyword search if an extension fails to provide docs

Not all external extensions provide docs; if you use such an extension, you
will experience a crash if you use "hg help --keyword <word>", and <word>
happens to match the extension name.

diff --git a/mercurial/help.py b/mercurial/help.py
--- a/mercurial/help.py
+++ b/mercurial/help.py
@@ -149,6 +149,8 @@
     for name, docs in itertools.chain(
         extensions.enabled(False).iteritems(),
         extensions.disabled().iteritems()):
+        if not docs:
+            continue
         mod = extensions.load(ui, name, '')
         name = name.rpartition('.')[-1]
         if lowercontains(name) or lowercontains(docs):


More information about the Mercurial-devel mailing list