help: check if a subtopic exists and raise an error if it doesn't (issue6145)
authorNathan Goldbaum <nathan12343@gmail.com>
Thu, 23 May 2019 10:47:10 -0400
changeset 42412 a84564b1a0b1
parent 42411 4372d56112c9
child 42413 ad55a0a5894f
help: check if a subtopic exists and raise an error if it doesn't (issue6145) Differential Revision: https://phab.mercurial-scm.org/D6441
mercurial/help.py
--- a/mercurial/help.py	Wed May 29 10:00:54 2019 -0400
+++ b/mercurial/help.py	Thu May 23 10:47:10 2019 -0400
@@ -689,6 +689,8 @@
             for names, header, doc in subtopics[name]:
                 if subtopic in names:
                     break
+            if not any(subtopic in s[0] for s in subtopics[name]):
+                raise error.UnknownCommand(name)
 
         if not header:
             for topic in helptable: