Mercurial > public > mercurial-scm > hg-stable
diff tests/test-phabricator.t @ 44456:09f3e003fc2a
phabricator: avoid a stacktrace when command arguments are missing
Previously, the TypeError wasn't properly converted to a SignatureError when
improper arguments were supplied to the inner function, because the stack depth
is 2 inside the vcrcommand decorator. The `__name__` and `__doc__` attributes
need to be reassigned to the new wrapper so that the help summary is available.
Differential Revision: https://phab.mercurial-scm.org/D8209
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 04 Mar 2020 00:45:54 -0500 |
parents | d1177d39012e |
children | bbb170f9396d |
line wrap: on
line diff
--- a/tests/test-phabricator.t Fri Jan 24 15:51:19 2020 -0800 +++ b/tests/test-phabricator.t Wed Mar 04 00:45:54 2020 -0500 @@ -29,6 +29,21 @@ > --test-vcr "$VCR/phabread-conduit-error.json" D4480 | head abort: Conduit Error (ERR-INVALID-AUTH): API token "cli-notavalidtoken" has the wrong length. API tokens should be 32 characters long. +Missing arguments print the command help + + $ hg phabread + hg phabread: invalid arguments + hg phabread DREVSPEC [OPTIONS] + + print patches from Phabricator suitable for importing + + options: + + --stack read dependencies + + (use 'hg phabread -h' to show more help) + [255] + Basic phabread: $ hg phabread --test-vcr "$VCR/phabread-4480.json" D4480 | head # HG changeset patch