Mercurial > hg-stable
annotate tests/test-check-module-imports.t @ 31695:2d11d278279a
ui: defer setting pager related properties until the pager has spawned
When --pager=on is given, dispatch.py spawns a pager before setting up color.
If the pager failed to launch, ui.pageractive was left set to True, so color
configured itself based on 'color.pagermode'. A typical MSYS setting would be
'color.mode=auto, color.pagermode=ansi'. In the failure case, this would print
a warning, disable the pager, and then print the raw ANSI codes to the terminal.
Care needs to be taken, because it appears that leaving ui.pageractive=True was
the only thing that prevented an attempt at running the pager again from inside
the command. This results in a double warning message, so pager is simply
disabled on failure.
The ui config settings didn't need to be moved to fix this, but it seemed like
the right thing to do for consistency.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 25 Mar 2017 21:12:00 -0400 |
parents | d3a56bb268ee |
children | 6c113a7dec52 |
rev | line source |
---|---|
23894
f388ceae2250
test-module-imports: use test-repo requirement
Matt Mackall <mpm@selenic.com>
parents:
22947
diff
changeset
|
1 #require test-repo |
f388ceae2250
test-module-imports: use test-repo requirement
Matt Mackall <mpm@selenic.com>
parents:
22947
diff
changeset
|
2 |
29219
3c9066ed557c
tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents:
29212
diff
changeset
|
3 $ . "$TESTDIR/helpers-testrepo.sh" |
20039
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
4 $ import_checker="$TESTDIR"/../contrib/import-checker.py |
23894
f388ceae2250
test-module-imports: use test-repo requirement
Matt Mackall <mpm@selenic.com>
parents:
22947
diff
changeset
|
5 |
20039
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
6 $ cd "$TESTDIR"/.. |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
7 |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
8 There are a handful of cases here that require renaming a module so it |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
9 doesn't overlap with a stdlib module name. There are also some cycles |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
10 here that we should still endeavor to fix, and some cycles will be |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
11 hidden by deduplication algorithm in the cycle detector, so fixing |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
12 these may expose other cycles. |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
13 |
28844
99a2bdad0fda
tests: enable import checker for tests/**.py files
Yuya Nishihara <yuya@tcha.org>
parents:
28330
diff
changeset
|
14 Known-bad files are excluded by -X as some of them would produce unstable |
99a2bdad0fda
tests: enable import checker for tests/**.py files
Yuya Nishihara <yuya@tcha.org>
parents:
28330
diff
changeset
|
15 outputs, which should be fixed later. |
99a2bdad0fda
tests: enable import checker for tests/**.py files
Yuya Nishihara <yuya@tcha.org>
parents:
28330
diff
changeset
|
16 |
29234
393aef802535
tests: enable import checker for all python files (including no .py files)
Yuya Nishihara <yuya@tcha.org>
parents:
29219
diff
changeset
|
17 $ hg locate 'set:**.py or grep(r"^#!.*?python")' \ |
28923
531dea16f4f7
tests: run import-checker with tests .t files
timeless <timeless@mozdev.org>
parents:
28844
diff
changeset
|
18 > 'tests/**.t' \ |
29212
8005e0e0eb33
tests: enable import checker for all **.py files
Yuya Nishihara <yuya@tcha.org>
parents:
29208
diff
changeset
|
19 > -X contrib/debugshell.py \ |
30444
b86a448a2965
zstd: vendor python-zstandard 0.5.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
29305
diff
changeset
|
20 > -X contrib/python-zstandard/ \ |
29212
8005e0e0eb33
tests: enable import checker for all **.py files
Yuya Nishihara <yuya@tcha.org>
parents:
29208
diff
changeset
|
21 > -X contrib/win32/hgwebdir_wsgi.py \ |
8005e0e0eb33
tests: enable import checker for all **.py files
Yuya Nishihara <yuya@tcha.org>
parents:
29208
diff
changeset
|
22 > -X doc/gendoc.py \ |
8005e0e0eb33
tests: enable import checker for all **.py files
Yuya Nishihara <yuya@tcha.org>
parents:
29208
diff
changeset
|
23 > -X doc/hgmanpage.py \ |
29234
393aef802535
tests: enable import checker for all python files (including no .py files)
Yuya Nishihara <yuya@tcha.org>
parents:
29219
diff
changeset
|
24 > -X i18n/posplit \ |
28844
99a2bdad0fda
tests: enable import checker for tests/**.py files
Yuya Nishihara <yuya@tcha.org>
parents:
28330
diff
changeset
|
25 > -X tests/test-hgweb-auth.py \ |
99a2bdad0fda
tests: enable import checker for tests/**.py files
Yuya Nishihara <yuya@tcha.org>
parents:
28330
diff
changeset
|
26 > -X tests/hypothesishelpers.py \ |
99a2bdad0fda
tests: enable import checker for tests/**.py files
Yuya Nishihara <yuya@tcha.org>
parents:
28330
diff
changeset
|
27 > -X tests/test-ctxmanager.py \ |
99a2bdad0fda
tests: enable import checker for tests/**.py files
Yuya Nishihara <yuya@tcha.org>
parents:
28330
diff
changeset
|
28 > -X tests/test-lock.py \ |
99a2bdad0fda
tests: enable import checker for tests/**.py files
Yuya Nishihara <yuya@tcha.org>
parents:
28330
diff
changeset
|
29 > -X tests/test-verify-repo-operations.py \ |
28923
531dea16f4f7
tests: run import-checker with tests .t files
timeless <timeless@mozdev.org>
parents:
28844
diff
changeset
|
30 > -X tests/test-hook.t \ |
531dea16f4f7
tests: run import-checker with tests .t files
timeless <timeless@mozdev.org>
parents:
28844
diff
changeset
|
31 > -X tests/test-import.t \ |
31451
d3a56bb268ee
import-checkers: split tests of the tool from running it on the source
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30444
diff
changeset
|
32 > -X tests/test-imports-checker.t \ |
28923
531dea16f4f7
tests: run import-checker with tests .t files
timeless <timeless@mozdev.org>
parents:
28844
diff
changeset
|
33 > -X tests/test-commit-interactive.t \ |
531dea16f4f7
tests: run import-checker with tests .t files
timeless <timeless@mozdev.org>
parents:
28844
diff
changeset
|
34 > -X tests/test-contrib-check-code.t \ |
531dea16f4f7
tests: run import-checker with tests .t files
timeless <timeless@mozdev.org>
parents:
28844
diff
changeset
|
35 > -X tests/test-extension.t \ |
531dea16f4f7
tests: run import-checker with tests .t files
timeless <timeless@mozdev.org>
parents:
28844
diff
changeset
|
36 > -X tests/test-hghave.t \ |
531dea16f4f7
tests: run import-checker with tests .t files
timeless <timeless@mozdev.org>
parents:
28844
diff
changeset
|
37 > -X tests/test-hgweb-no-path-info.t \ |
531dea16f4f7
tests: run import-checker with tests .t files
timeless <timeless@mozdev.org>
parents:
28844
diff
changeset
|
38 > -X tests/test-hgweb-no-request-uri.t \ |
531dea16f4f7
tests: run import-checker with tests .t files
timeless <timeless@mozdev.org>
parents:
28844
diff
changeset
|
39 > -X tests/test-hgweb-non-interactive.t \ |
28844
99a2bdad0fda
tests: enable import checker for tests/**.py files
Yuya Nishihara <yuya@tcha.org>
parents:
28330
diff
changeset
|
40 > | sed 's-\\-/-g' | python "$import_checker" - |