changeset 30878:f36eec4b5a49

help: show section that couldn't be found For better error indication.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 05 Feb 2017 18:57:19 +0900
parents 8d7e40524ae4
children 5fbf1da938a6
files mercurial/commands.py tests/test-help.t
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Feb 03 16:01:19 2017 -0500
+++ b/mercurial/commands.py	Sun Feb 05 18:57:19 2017 +0900
@@ -3916,6 +3916,7 @@
     if ui.verbose:
         keep.append('verbose')
 
+    fullname = name
     section = None
     subtopic = None
     if name and '.' in name:
@@ -3938,7 +3939,7 @@
     # to look for, or we could have simply failed to found "foo.bar"
     # because bar isn't a section of foo
     if section and not (formatted and name):
-        raise error.Abort(_("help section not found"))
+        raise error.Abort(_("help section not found: %s") % fullname)
 
     if 'verbose' in pruned:
         keep.append('omitted')
--- a/tests/test-help.t	Fri Feb 03 16:01:19 2017 -0500
+++ b/tests/test-help.t	Sun Feb 05 18:57:19 2017 +0900
@@ -1547,11 +1547,11 @@
          "default:pushurl" should be used instead.
   
   $ hg help glossary.mcguffin
-  abort: help section not found
+  abort: help section not found: glossary.mcguffin
   [255]
 
   $ hg help glossary.mc.guffin
-  abort: help section not found
+  abort: help section not found: glossary.mc.guffin
   [255]
 
   $ hg help template.files