##// END OF EJS Templates
test-check-code: prevent from adding Python modules shadowed by ancient C
Yuya Nishihara -
r37822:1ec87471 4.6rc1 stable
parent child Browse files
Show More
@@ -1,53 +1,65 b''
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ check_code="$TESTDIR"/../contrib/check-code.py
4 $ check_code="$TESTDIR"/../contrib/check-code.py
5 $ cd "$TESTDIR"/..
5 $ cd "$TESTDIR"/..
6
6
7 New errors are not allowed. Warnings are strongly discouraged.
7 New errors are not allowed. Warnings are strongly discouraged.
8 (The writing "no-che?k-code" is for not skipping this file when checking.)
8 (The writing "no-che?k-code" is for not skipping this file when checking.)
9
9
10 $ testrepohg locate \
10 $ testrepohg locate \
11 > -X contrib/python-zstandard \
11 > -X contrib/python-zstandard \
12 > -X hgext/fsmonitor/pywatchman \
12 > -X hgext/fsmonitor/pywatchman \
13 > -X mercurial/thirdparty \
13 > -X mercurial/thirdparty \
14 > | sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
14 > | sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
15 Skipping i18n/polib.py it has no-che?k-code (glob)
15 Skipping i18n/polib.py it has no-che?k-code (glob)
16 Skipping mercurial/statprof.py it has no-che?k-code (glob)
16 Skipping mercurial/statprof.py it has no-che?k-code (glob)
17 Skipping tests/badserverext.py it has no-che?k-code (glob)
17 Skipping tests/badserverext.py it has no-che?k-code (glob)
18
18
19 @commands in debugcommands.py should be in alphabetical order.
19 @commands in debugcommands.py should be in alphabetical order.
20
20
21 >>> import re
21 >>> import re
22 >>> commands = []
22 >>> commands = []
23 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
23 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
24 ... for line in fh:
24 ... for line in fh:
25 ... m = re.match("^@command\('([a-z]+)", line)
25 ... m = re.match("^@command\('([a-z]+)", line)
26 ... if m:
26 ... if m:
27 ... commands.append(m.group(1))
27 ... commands.append(m.group(1))
28 >>> scommands = list(sorted(commands))
28 >>> scommands = list(sorted(commands))
29 >>> for i, command in enumerate(scommands):
29 >>> for i, command in enumerate(scommands):
30 ... if command != commands[i]:
30 ... if command != commands[i]:
31 ... print('commands in debugcommands.py not sorted; first differing '
31 ... print('commands in debugcommands.py not sorted; first differing '
32 ... 'command is %s; expected %s' % (commands[i], command))
32 ... 'command is %s; expected %s' % (commands[i], command))
33 ... break
33 ... break
34
34
35 Prevent adding new files in the root directory accidentally.
35 Prevent adding new files in the root directory accidentally.
36
36
37 $ testrepohg files 'glob:*'
37 $ testrepohg files 'glob:*'
38 .arcconfig
38 .arcconfig
39 .clang-format
39 .clang-format
40 .editorconfig
40 .editorconfig
41 .hgignore
41 .hgignore
42 .hgsigs
42 .hgsigs
43 .hgtags
43 .hgtags
44 .jshintrc
44 .jshintrc
45 CONTRIBUTING
45 CONTRIBUTING
46 CONTRIBUTORS
46 CONTRIBUTORS
47 COPYING
47 COPYING
48 Makefile
48 Makefile
49 README.rst
49 README.rst
50 hg
50 hg
51 hgeditor
51 hgeditor
52 hgweb.cgi
52 hgweb.cgi
53 setup.py
53 setup.py
54
55 Prevent adding modules which could be shadowed by ancient .so/.dylib.
56
57 $ testrepohg files \
58 > mercurial/base85.py \
59 > mercurial/bdiff.py \
60 > mercurial/diffhelpers.py \
61 > mercurial/mpatch.py \
62 > mercurial/osutil.py \
63 > mercurial/parsers.py \
64 > mercurial/zstd.py
65 [1]
General Comments 0
You need to be logged in to leave comments. Login now