sapling/tests/test-fb-hgext-morecolors.t
Kostia Balytskyi b27a46c987 fb-hgext: fix copied fb-hgext tests
Summary:
This is a big bulk of generally almost-obvious fixes to the moved tests. Mostly
these fixes have to do with correct importing of the actual extensions.

Depends on D6675329

Test Plan:
- ./run-tests.py fails less after this commit
- see further commits for more test fixes

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675344
2018-01-09 03:06:09 -08:00

40 lines
1.1 KiB
Perl

$ cat >> $HGRCPATH << EOF
> [extensions]
> morecolors=
> [ui]
> color=always
> [color]
> mode=ansi
> EOF
Traceback has color:
$ cat > repocrash.py << EOF
> from mercurial import error
> def reposetup(ui, repo):
> raise error.Abort('.')
> EOF
$ hg init repo1
$ cd repo1
$ hg commit --config extensions.repocrash=$TESTTMP/repocrash.py --traceback 2>&1 | egrep -v '^ '
Traceback (most recent call last):
\x1b[0;31;1m File "$TESTTMP/repocrash.py", line 3, in reposetup\x1b[0m (esc)
\x1b[0;31;1m raise error.Abort('.')\x1b[0m (esc)
\x1b[0;31;1mAbort: .\x1b[0m (esc)
abort: .
Uncaught exception has color:
$ cat > $TESTTMP/uncaughtcrash.py <<EOF
> def reposetup(ui, repo):
> raise RuntimeError('.')
> EOF
$ hg commit --config extensions.repocrash=$TESTTMP/uncaughtcrash.py 2>&1 | egrep -v '^ '
Traceback (most recent call last):
\x1b[0;31;1m File "$TESTTMP/uncaughtcrash.py", line 2, in reposetup\x1b[0m (esc)
\x1b[0;31;1m raise RuntimeError('.')\x1b[0m (esc)
\x1b[0;31;1mRuntimeError: .\x1b[0m (esc)