1 #require test-repo |
1 #require test-repo |
2 |
2 |
3 $ . "$TESTDIR/helpers-testrepo.sh" |
3 $ . "$TESTDIR/helpers-testrepo.sh" |
|
4 |
|
5 Sanity check check-config.py |
|
6 |
|
7 $ cat > testfile.py << EOF |
|
8 > # Good |
|
9 > foo = ui.config('ui', 'username') |
|
10 > # Missing |
|
11 > foo = ui.config('ui', 'doesnotexist') |
|
12 > # Missing different type |
|
13 > foo = ui.configint('ui', 'missingint') |
|
14 > # Missing with default value |
|
15 > foo = ui.configbool('ui', 'missingbool1', default=True) |
|
16 > foo = ui.configbool('ui', 'missingbool2', False) |
|
17 > EOF |
|
18 |
|
19 $ cat > files << EOF |
|
20 > mercurial/help/config.txt |
|
21 > $TESTTMP/testfile.py |
|
22 > EOF |
|
23 |
4 $ cd "$TESTDIR"/.. |
24 $ cd "$TESTDIR"/.. |
|
25 |
|
26 $ python contrib/check-config.py < $TESTTMP/files |
|
27 undocumented: ui.doesnotexist (str) |
|
28 undocumented: ui.missingbool1 (bool) [True] |
|
29 undocumented: ui.missingbool2 (bool) |
|
30 undocumented: ui.missingint (int) |
5 |
31 |
6 New errors are not allowed. Warnings are strongly discouraged. |
32 New errors are not allowed. Warnings are strongly discouraged. |
7 |
33 |
8 $ hg files "set:(**.py or **.txt) - tests/**" | sed 's|\\|/|g' | |
34 $ hg files "set:(**.py or **.txt) - tests/**" | sed 's|\\|/|g' | |
9 > python contrib/check-config.py |
35 > python contrib/check-config.py |