changeset 42393:a84564b1a0b1

help: check if a subtopic exists and raise an error if it doesn't (issue6145) Differential Revision: https://phab.mercurial-scm.org/D6441
author Nathan Goldbaum <nathan12343@gmail.com>
date Thu, 23 May 2019 10:47:10 -0400
parents 4372d56112c9
children ad55a0a5894f
files mercurial/help.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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: