tests/crashgetbundler.py
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 04 Mar 2020 00:45:54 -0500
changeset 44436 09f3e003fc2a
parent 43076 2372284d9457
child 48875 6000f5b25c9b
permissions -rw-r--r--
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

from __future__ import absolute_import

from mercurial.i18n import _
from mercurial import changegroup, error, extensions


def abort(orig, *args, **kwargs):
    raise error.Abort(_('this is an exercise'))


def uisetup(ui):
    extensions.wrapfunction(changegroup, 'getbundler', abort)