# HG changeset patch # User Martin von Zweigbergk # Date 1610606241 28800 # Node ID c9b2a4d69e66884603c9345466ab842149e14dc7 # Parent abba2d365373f844c5e15517115193fe95d9a28b errors: raise InputError when non-existent help section requested Differential Revision: https://phab.mercurial-scm.org/D9776 diff -r abba2d365373 -r c9b2a4d69e66 mercurial/help.py --- a/mercurial/help.py Fri Jan 15 12:56:25 2021 -0500 +++ b/mercurial/help.py Wed Jan 13 22:37:21 2021 -0800 @@ -1064,7 +1064,7 @@ if not rst: msg = _(b'no matches') hint = _(b"try 'hg help' for a list of topics") - raise error.Abort(msg, hint=hint) + raise error.InputError(msg, hint=hint) elif name and name != b'shortlist': queries = [] if unknowncmd: @@ -1095,7 +1095,7 @@ hintname = name msg = _(b'no such help topic: %s') % formatname hint = _(b"try 'hg help --keyword %s'") % hintname - raise error.Abort(msg, hint=hint) + raise error.InputError(msg, hint=hint) else: # program name if not ui.quiet: @@ -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) diff -r abba2d365373 -r c9b2a4d69e66 tests/test-extdiff.t --- a/tests/test-extdiff.t Fri Jan 15 12:56:25 2021 -0500 +++ b/tests/test-extdiff.t Wed Jan 13 22:37:21 2021 -0800 @@ -513,14 +513,14 @@ $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help -k xyzzy abort: no matches (try 'hg help' for a list of topics) - [255] + [10] $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help td > /dev/null $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help -k xyzzy abort: no matches (try 'hg help' for a list of topics) - [255] + [10] $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td \ > | grep "^ '" diff -r abba2d365373 -r c9b2a4d69e66 tests/test-help.t --- a/tests/test-help.t Fri Jan 15 12:56:25 2021 -0500 +++ b/tests/test-help.t Wed Jan 13 22:37:21 2021 -0800 @@ -758,7 +758,7 @@ $ hg help foo abort: no such help topic: foo (try 'hg help --keyword foo') - [255] + [10] $ hg skjdfks hg: unknown command 'skjdfks' @@ -1345,7 +1345,7 @@ $ hg help internals.foo abort: no such help topic: internals.foo (try 'hg help --keyword foo') - [255] + [10] test advanced, deprecated and experimental options are hidden in command help $ hg help debugoptADV @@ -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 @@ -1655,7 +1655,7 @@ $ hg help -c schemes abort: no such help topic: schemes (try 'hg help --keyword schemes') - [255] + [10] $ hg help -e schemes |head -1 schemes extension - extend schemes with shortcuts to repository swarms $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):' @@ -1670,7 +1670,7 @@ $ hg help -e commit abort: no such help topic: commit (try 'hg help --keyword commit') - [255] + [10] Test keyword search help @@ -1715,14 +1715,14 @@ $ hg help nonexistingtopicthatwillneverexisteverever abort: no such help topic: nonexistingtopicthatwillneverexisteverever (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever') - [255] + [10] Test unfound keyword $ hg help --keyword nonexistingwordthatwillneverexisteverever abort: no matches (try 'hg help' for a list of topics) - [255] + [10] Test omit indicating for help @@ -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