mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
8a3a99ba21
Summary: Be a better citizen under system python path. Fix all tests issues and change setup.py to use glob pattern to include all extensions. Test Plan: Run tests and `make local`. Also build and install the package and run `hg sl` in major repos. Reviewers: #mercurial, ttung, rmcelroy Reviewed By: rmcelroy Subscribers: rmcelroy, durham, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D3534311 Signature: t1:3534311:1468275426:fe122646c8bd6c541e1889e73e9df28f86747ff2
26 lines
743 B
Perl
26 lines
743 B
Perl
$ extpath=`dirname $TESTDIR`
|
|
$ cp $extpath/hgext3rd/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 overridden-message'
|
|
overridden-message
|
|
[255]
|