Patchwork D9776: errors: raise InputError when non-existent help section requested

login
register
mail settings
Submitter phabricator
Date Jan. 14, 2021, 4:34 p.m.
Message ID <differential-rev-PHID-DREV-lisxde6otmwo2hgwrepw-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48087/
State Superseded
Headers show

Comments

phabricator - Jan. 14, 2021, 4:34 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9776

AFFECTED FILES
  mercurial/help.py
  tests/test-help.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1479,7 +1479,7 @@ 
 
   $ hg help config.annotate.git
   abort: help section not found: config.annotate.git
-  [255]
+  [10]
 
   $ hg help config.update.check
       "commands.update.check"
@@ -1509,7 +1509,7 @@ 
 
   $ hg help config.ommands.update.check
   abort: help section not found: config.ommands.update.check
-  [255]
+  [10]
 
 Unrelated trailing paragraphs shouldn't be included
 
@@ -1869,11 +1869,11 @@ 
   
   $ hg help glossary.mcguffin
   abort: help section not found: glossary.mcguffin
-  [255]
+  [10]
 
   $ hg help glossary.mc.guffin
   abort: help section not found: glossary.mc.guffin
-  [255]
+  [10]
 
   $ hg help template.files
       files         List of strings. All files modified, added, or removed by
diff --git a/mercurial/help.py b/mercurial/help.py
--- a/mercurial/help.py
+++ b/mercurial/help.py
@@ -1155,6 +1155,6 @@ 
     # 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 (blocks and name):
-        raise error.Abort(_(b"help section not found: %s") % fullname)
+        raise error.InputError(_(b"help section not found: %s") % fullname)
 
     return minirst.formatplain(blocks, textwidth)