mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
f0aac1fe38
Summary: When a command fails, the commandfailure signal is logged. Use the information provided by this log call to suppress the warning and all traceback information. In combination with the logtoprocessui extension, this should replace the less generic errorredirect extension. Depends on D3082490 Test Plan: run $HG/tests/runtest.py test-suppresscommandfailure.t Reviewers: #sourcecontrol, quark, ttung, durham Reviewed By: durham Subscribers: mjpieters, #sourcecontrol Differential Revision: https://phabricator.fb.com/D3084144 Signature: t1:3084144:1458755837:39fea58ed89d03a611bfcfffa88af68a2d55fddc
23 lines
617 B
Perl
23 lines
617 B
Perl
Test if suppresscommandfailure correctly suppresses a commandexception warning.
|
|
|
|
$ hg init
|
|
$ extpath=`dirname $TESTDIR`
|
|
$ cp $extpath/suppresscommandfailure.py $TESTTMP
|
|
$ cat > $TESTTMP/crash.py << EOF
|
|
> from mercurial import cmdutil
|
|
> cmdtable = {}
|
|
> command = cmdutil.command(cmdtable)
|
|
> @command('crash', [])
|
|
> def crash(ui, repo):
|
|
> raise ValueError('crash')
|
|
> EOF
|
|
$ cat >> $HGRCPATH << EOF
|
|
> [extensions]
|
|
> suppresscommandfailure=$TESTTMP/suppresscommandfailure.py
|
|
> crash=$TESTTMP/crash.py
|
|
> EOF
|
|
|
|
Test the extension will override the normal warning output
|
|
$ hg crash
|
|
[1]
|