diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -686,9 +686,13 @@ # Look for sub-topic entry first. header, doc = None, None if subtopic and name in subtopics: + exists = False for names, header, doc in subtopics[name]: if subtopic in names: + exists = True break + if not exists: + raise error.UnknownCommand(name) if not header: for topic in helptable: