# HG changeset patch # User Nathan Goldbaum # Date 2019-05-23 14:47:10 # Node ID a84564b1a0b1dd58174ff29adbf88a0a033e5251 # Parent 4372d56112c9b3b027b703cf261bc7cf858c1666 help: check if a subtopic exists and raise an error if it doesn't (issue6145) Differential Revision: https://phab.mercurial-scm.org/D6441 diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -689,6 +689,8 @@ def help_(ui, commands, name, unknowncmd 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: