mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
0ca941a08a
Summary: This diff is part of a series to cleanup fb-hgext and make it pass check-code. Test Plan: all tests pass Reviewers: #sourcecontrol, ttung, mitrandir, akushner Reviewed By: akushner Subscribers: mpm, akushner, mitrandir Differential Revision: https://phabricator.fb.com/D2811997 Signature: t1:2811997:1452200059:9e4fca501a22f95d2d9a22d234758f55e292ea9a
26 lines
730 B
Perl
26 lines
730 B
Perl
$ extpath=`dirname $TESTDIR`
|
|
$ cp $extpath/errorredirect.py $TESTTMP
|
|
$ cat > $TESTTMP/crash.py << EOF
|
|
> from mercurial import cmdutil
|
|
> cmdtable = {}
|
|
> command = cmdutil.command(cmdtable)
|
|
> @command('crash', [])
|
|
> def crash(ui, repo):
|
|
> raise 'crash'
|
|
> EOF
|
|
$ cat >> $HGRCPATH << EOF
|
|
> [extensions]
|
|
> errorredirect=$TESTTMP/errorredirect.py
|
|
> crash=$TESTTMP/crash.py
|
|
> EOF
|
|
|
|
Test errorredirect will respect original behavior by default
|
|
$ hg init
|
|
$ hg crash 2>&1 | grep -o 'Unknown exception encountered'
|
|
Unknown exception encountered
|
|
|
|
Test the errorredirect script will override stack trace output
|
|
$ hg crash --config errorredirect.script='echo overrided-message'
|
|
overrided-message
|
|
[1]
|