##// END OF EJS Templates
tests: alias syshg and syshgenv so they can be switched conditionally
Yuya Nishihara -
r33199:ddd65b4f default
parent child Browse files
Show More
@@ -1,37 +1,36
1 # Invoke the system hg installation (rather than the local hg version being
1 # Invoke the system hg installation (rather than the local hg version being
2 # tested).
2 # tested).
3 #
3 #
4 # We want to use the hg version being tested when interacting with the test
4 # We want to use the hg version being tested when interacting with the test
5 # repository, and the system hg when interacting with the mercurial source code
5 # repository, and the system hg when interacting with the mercurial source code
6 # repository.
6 # repository.
7 #
7 #
8 # The mercurial source repository was typically orignally cloned with the
8 # The mercurial source repository was typically orignally cloned with the
9 # system mercurial installation, and may require extensions or settings from
9 # system mercurial installation, and may require extensions or settings from
10 # the system installation.
10 # the system installation.
11 syshg () {
11 syshg () {
12 (
12 (
13 syshgenv
13 syshgenv
14 exec hg "$@"
14 exec hg "$@"
15 )
15 )
16 }
16 }
17
17
18 # Revert the environment so that running "hg" runs the system hg
18 # Revert the environment so that running "hg" runs the system hg
19 # rather than the test hg installation.
19 # rather than the test hg installation.
20 syshgenv () {
20 syshgenv () {
21 . "$HGTEST_RESTOREENV"
21 . "$HGTEST_RESTOREENV"
22 HGPLAIN=1
22 HGPLAIN=1
23 export HGPLAIN
23 export HGPLAIN
24 }
24 }
25
25
26 # Most test-check-* sourcing this file run "hg files", which is not available
26 # Most test-check-* sourcing this file run "hg files", which is not available
27 # in ancient versions of hg. So we double check if "syshg files" works and
27 # in ancient versions of hg. So we double check if "syshg files" works and
28 # fallback to hg bundled in the repo.
28 # fallback to hg bundled in the repo.
29 syshg files -h >/dev/null 2>/dev/null
29 syshg files -h >/dev/null 2>/dev/null
30 if [ $? -ne 0 ]; then
30 if [ $? -eq 0 ]; then
31 syshg() {
31 alias testrepohg=syshg
32 hg "$@"
32 alias testrepohgenv=syshgenv
33 }
33 else
34 syshgenv() {
34 alias testrepohg=hg
35 :
35 alias testrepohgenv=:
36 }
37 fi
36 fi
@@ -1,49 +1,50
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 $ syshg locate -X contrib/python-zstandard -X hgext/fsmonitor/pywatchman |
10 $ testrepohg locate -X contrib/python-zstandard \
11 > -X hgext/fsmonitor/pywatchman |
11 > sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
12 > sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
12 Skipping i18n/polib.py it has no-che?k-code (glob)
13 Skipping i18n/polib.py it has no-che?k-code (glob)
13 Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob)
14 Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob)
14 Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob)
15 Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob)
15 Skipping mercurial/statprof.py it has no-che?k-code (glob)
16 Skipping mercurial/statprof.py it has no-che?k-code (glob)
16 Skipping tests/badserverext.py it has no-che?k-code (glob)
17 Skipping tests/badserverext.py it has no-che?k-code (glob)
17
18
18 @commands in debugcommands.py should be in alphabetical order.
19 @commands in debugcommands.py should be in alphabetical order.
19
20
20 >>> import re
21 >>> import re
21 >>> commands = []
22 >>> commands = []
22 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
23 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
23 ... for line in fh:
24 ... for line in fh:
24 ... m = re.match("^@command\('([a-z]+)", line)
25 ... m = re.match("^@command\('([a-z]+)", line)
25 ... if m:
26 ... if m:
26 ... commands.append(m.group(1))
27 ... commands.append(m.group(1))
27 >>> scommands = list(sorted(commands))
28 >>> scommands = list(sorted(commands))
28 >>> for i, command in enumerate(scommands):
29 >>> for i, command in enumerate(scommands):
29 ... if command != commands[i]:
30 ... if command != commands[i]:
30 ... print('commands in debugcommands.py not sorted; first differing '
31 ... print('commands in debugcommands.py not sorted; first differing '
31 ... 'command is %s; expected %s' % (commands[i], command))
32 ... 'command is %s; expected %s' % (commands[i], command))
32 ... break
33 ... break
33
34
34 Prevent adding new files in the root directory accidentally.
35 Prevent adding new files in the root directory accidentally.
35
36
36 $ syshg files 'glob:*'
37 $ testrepohg files 'glob:*'
37 .editorconfig
38 .editorconfig
38 .hgignore
39 .hgignore
39 .hgsigs
40 .hgsigs
40 .hgtags
41 .hgtags
41 CONTRIBUTING
42 CONTRIBUTING
42 CONTRIBUTORS
43 CONTRIBUTORS
43 COPYING
44 COPYING
44 Makefile
45 Makefile
45 README
46 README
46 hg
47 hg
47 hgeditor
48 hgeditor
48 hgweb.cgi
49 hgweb.cgi
49 setup.py
50 setup.py
@@ -1,21 +1,22
1 #require test-repo
1 #require test-repo
2
2
3 Enable obsolescence to avoid the warning issue when obsmarker are found
3 Enable obsolescence to avoid the warning issue when obsmarker are found
4
4
5 $ . "$TESTDIR/helpers-testrepo.sh"
5 $ . "$TESTDIR/helpers-testrepo.sh"
6
6
7 Go back in the hg repo
7 Go back in the hg repo
8
8
9 $ cd $TESTDIR/..
9 $ cd $TESTDIR/..
10
10
11 $ for node in `syshg log --rev 'not public() and ::. and not desc("# no-check-commit")' --template '{node|short}\n'`; do
11 $ for node in `testrepohg log --rev 'not public() and ::. and not desc("# no-check-commit")' --template '{node|short}\n'`; do
12 > syshg export --git $node | contrib/check-commit > ${TESTTMP}/check-commit.out
12 > testrepohg export --git $node \
13 > | contrib/check-commit > ${TESTTMP}/check-commit.out
13 > if [ $? -ne 0 ]; then
14 > if [ $? -ne 0 ]; then
14 > echo "Revision $node does not comply with rules"
15 > echo "Revision $node does not comply with rules"
15 > echo '------------------------------------------------------'
16 > echo '------------------------------------------------------'
16 > cat ${TESTTMP}/check-commit.out
17 > cat ${TESTTMP}/check-commit.out
17 > echo
18 > echo
18 > fi
19 > fi
19 > done
20 > done
20
21
21
22
@@ -1,47 +1,47
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4
4
5 Sanity check check-config.py
5 Sanity check check-config.py
6
6
7 $ cat > testfile.py << EOF
7 $ cat > testfile.py << EOF
8 > # Good
8 > # Good
9 > foo = ui.config('ui', 'username')
9 > foo = ui.config('ui', 'username')
10 > # Missing
10 > # Missing
11 > foo = ui.config('ui', 'doesnotexist')
11 > foo = ui.config('ui', 'doesnotexist')
12 > # Missing different type
12 > # Missing different type
13 > foo = ui.configint('ui', 'missingint')
13 > foo = ui.configint('ui', 'missingint')
14 > # Missing with default value
14 > # Missing with default value
15 > foo = ui.configbool('ui', 'missingbool1', default=True)
15 > foo = ui.configbool('ui', 'missingbool1', default=True)
16 > foo = ui.configbool('ui', 'missingbool2', False)
16 > foo = ui.configbool('ui', 'missingbool2', False)
17 > # Inconsistent values for defaults.
17 > # Inconsistent values for defaults.
18 > foo = ui.configint('ui', 'intdefault', default=1)
18 > foo = ui.configint('ui', 'intdefault', default=1)
19 > foo = ui.configint('ui', 'intdefault', default=42)
19 > foo = ui.configint('ui', 'intdefault', default=42)
20 > # Can suppress inconsistent value error
20 > # Can suppress inconsistent value error
21 > foo = ui.configint('ui', 'intdefault2', default=1)
21 > foo = ui.configint('ui', 'intdefault2', default=1)
22 > # inconsistent config: ui.intdefault2
22 > # inconsistent config: ui.intdefault2
23 > foo = ui.configint('ui', 'intdefault2', default=42)
23 > foo = ui.configint('ui', 'intdefault2', default=42)
24 > EOF
24 > EOF
25
25
26 $ cat > files << EOF
26 $ cat > files << EOF
27 > mercurial/help/config.txt
27 > mercurial/help/config.txt
28 > $TESTTMP/testfile.py
28 > $TESTTMP/testfile.py
29 > EOF
29 > EOF
30
30
31 $ cd "$TESTDIR"/..
31 $ cd "$TESTDIR"/..
32
32
33 $ $PYTHON contrib/check-config.py < $TESTTMP/files
33 $ $PYTHON contrib/check-config.py < $TESTTMP/files
34 foo = ui.configint('ui', 'intdefault', default=42)
34 foo = ui.configint('ui', 'intdefault', default=42)
35
35
36 conflict on ui.intdefault: ('int', '42') != ('int', '1')
36 conflict on ui.intdefault: ('int', '42') != ('int', '1')
37 undocumented: ui.doesnotexist (str)
37 undocumented: ui.doesnotexist (str)
38 undocumented: ui.intdefault (int) [42]
38 undocumented: ui.intdefault (int) [42]
39 undocumented: ui.intdefault2 (int) [42]
39 undocumented: ui.intdefault2 (int) [42]
40 undocumented: ui.missingbool1 (bool) [True]
40 undocumented: ui.missingbool1 (bool) [True]
41 undocumented: ui.missingbool2 (bool)
41 undocumented: ui.missingbool2 (bool)
42 undocumented: ui.missingint (int)
42 undocumented: ui.missingint (int)
43
43
44 New errors are not allowed. Warnings are strongly discouraged.
44 New errors are not allowed. Warnings are strongly discouraged.
45
45
46 $ syshg files "set:(**.py or **.txt) - tests/**" | sed 's|\\|/|g' |
46 $ testrepohg files "set:(**.py or **.txt) - tests/**" | sed 's|\\|/|g' |
47 > $PYTHON contrib/check-config.py
47 > $PYTHON contrib/check-config.py
@@ -1,24 +1,24
1 #require test-repo execbit
1 #require test-repo execbit
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ cd "`dirname "$TESTDIR"`"
4 $ cd "`dirname "$TESTDIR"`"
5
5
6 look for python scripts without the execute bit
6 look for python scripts without the execute bit
7
7
8 $ syshg files 'set:**.py and not exec() and grep(r"^#!.*?python")'
8 $ testrepohg files 'set:**.py and not exec() and grep(r"^#!.*?python")'
9 [1]
9 [1]
10
10
11 look for python scripts with execute bit but not shebang
11 look for python scripts with execute bit but not shebang
12
12
13 $ syshg files 'set:**.py and exec() and not grep(r"^#!.*?python")'
13 $ testrepohg files 'set:**.py and exec() and not grep(r"^#!.*?python")'
14 [1]
14 [1]
15
15
16 look for shell scripts with execute bit but not shebang
16 look for shell scripts with execute bit but not shebang
17
17
18 $ syshg files 'set:**.sh and exec() and not grep(r"^#!.*(ba)?sh")'
18 $ testrepohg files 'set:**.sh and exec() and not grep(r"^#!.*(ba)?sh")'
19 [1]
19 [1]
20
20
21 look for non scripts with no shebang
21 look for non scripts with no shebang
22
22
23 $ syshg files 'set:exec() and not **.sh and not **.py and not grep(r"^#!")'
23 $ testrepohg files 'set:exec() and not **.sh and not **.py and not grep(r"^#!")'
24 [1]
24 [1]
@@ -1,29 +1,29
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4
4
5 $ cat <<'EOF' > scanhelptopics.py
5 $ cat <<'EOF' > scanhelptopics.py
6 > from __future__ import absolute_import, print_function
6 > from __future__ import absolute_import, print_function
7 > import re
7 > import re
8 > import sys
8 > import sys
9 > if sys.platform == "win32":
9 > if sys.platform == "win32":
10 > import os, msvcrt
10 > import os, msvcrt
11 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
11 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
12 > topics = set()
12 > topics = set()
13 > topicre = re.compile(r':hg:`help ([a-z0-9\-.]+)`')
13 > topicre = re.compile(r':hg:`help ([a-z0-9\-.]+)`')
14 > for fname in sys.argv:
14 > for fname in sys.argv:
15 > with open(fname) as f:
15 > with open(fname) as f:
16 > topics.update(m.group(1) for m in topicre.finditer(f.read()))
16 > topics.update(m.group(1) for m in topicre.finditer(f.read()))
17 > for s in sorted(topics):
17 > for s in sorted(topics):
18 > print(s)
18 > print(s)
19 > EOF
19 > EOF
20
20
21 $ cd "$TESTDIR"/..
21 $ cd "$TESTDIR"/..
22
22
23 Check if ":hg:`help TOPIC`" is valid:
23 Check if ":hg:`help TOPIC`" is valid:
24 (use "xargs -n1 -t" to see which help commands are executed)
24 (use "xargs -n1 -t" to see which help commands are executed)
25
25
26 $ syshg files 'glob:{hgdemandimport,hgext,mercurial}/**/*.py' \
26 $ testrepohg files 'glob:{hgdemandimport,hgext,mercurial}/**/*.py' \
27 > | sed 's|\\|/|g' \
27 > | sed 's|\\|/|g' \
28 > | xargs $PYTHON "$TESTTMP/scanhelptopics.py" \
28 > | xargs $PYTHON "$TESTTMP/scanhelptopics.py" \
29 > | xargs -n1 hg help > /dev/null
29 > | xargs -n1 hg help > /dev/null
@@ -1,40 +1,40
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ import_checker="$TESTDIR"/../contrib/import-checker.py
4 $ import_checker="$TESTDIR"/../contrib/import-checker.py
5
5
6 $ cd "$TESTDIR"/..
6 $ cd "$TESTDIR"/..
7
7
8 There are a handful of cases here that require renaming a module so it
8 There are a handful of cases here that require renaming a module so it
9 doesn't overlap with a stdlib module name. There are also some cycles
9 doesn't overlap with a stdlib module name. There are also some cycles
10 here that we should still endeavor to fix, and some cycles will be
10 here that we should still endeavor to fix, and some cycles will be
11 hidden by deduplication algorithm in the cycle detector, so fixing
11 hidden by deduplication algorithm in the cycle detector, so fixing
12 these may expose other cycles.
12 these may expose other cycles.
13
13
14 Known-bad files are excluded by -X as some of them would produce unstable
14 Known-bad files are excluded by -X as some of them would produce unstable
15 outputs, which should be fixed later.
15 outputs, which should be fixed later.
16
16
17 $ syshg locate 'set:**.py or grep(r"^#!.*?python")' \
17 $ testrepohg locate 'set:**.py or grep(r"^#!.*?python")' \
18 > 'tests/**.t' \
18 > 'tests/**.t' \
19 > -X contrib/debugshell.py \
19 > -X contrib/debugshell.py \
20 > -X contrib/python-zstandard/ \
20 > -X contrib/python-zstandard/ \
21 > -X contrib/win32/hgwebdir_wsgi.py \
21 > -X contrib/win32/hgwebdir_wsgi.py \
22 > -X doc/gendoc.py \
22 > -X doc/gendoc.py \
23 > -X doc/hgmanpage.py \
23 > -X doc/hgmanpage.py \
24 > -X i18n/posplit \
24 > -X i18n/posplit \
25 > -X tests/test-hgweb-auth.py \
25 > -X tests/test-hgweb-auth.py \
26 > -X tests/hypothesishelpers.py \
26 > -X tests/hypothesishelpers.py \
27 > -X tests/test-ctxmanager.py \
27 > -X tests/test-ctxmanager.py \
28 > -X tests/test-lock.py \
28 > -X tests/test-lock.py \
29 > -X tests/test-verify-repo-operations.py \
29 > -X tests/test-verify-repo-operations.py \
30 > -X tests/test-hook.t \
30 > -X tests/test-hook.t \
31 > -X tests/test-import.t \
31 > -X tests/test-import.t \
32 > -X tests/test-imports-checker.t \
32 > -X tests/test-imports-checker.t \
33 > -X tests/test-commit-interactive.t \
33 > -X tests/test-commit-interactive.t \
34 > -X tests/test-contrib-check-code.t \
34 > -X tests/test-contrib-check-code.t \
35 > -X tests/test-extension.t \
35 > -X tests/test-extension.t \
36 > -X tests/test-hghave.t \
36 > -X tests/test-hghave.t \
37 > -X tests/test-hgweb-no-path-info.t \
37 > -X tests/test-hgweb-no-path-info.t \
38 > -X tests/test-hgweb-no-request-uri.t \
38 > -X tests/test-hgweb-no-request-uri.t \
39 > -X tests/test-hgweb-non-interactive.t \
39 > -X tests/test-hgweb-non-interactive.t \
40 > | sed 's-\\-/-g' | python "$import_checker" -
40 > | sed 's-\\-/-g' | python "$import_checker" -
@@ -1,44 +1,46
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ cd "$TESTDIR"/..
4 $ cd "$TESTDIR"/..
5
5
6 $ syshg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON contrib/check-py3-compat.py
6 $ testrepohg files 'set:(**.py)' | sed 's|\\|/|g' \
7 > | xargs $PYTHON contrib/check-py3-compat.py
7 contrib/python-zstandard/setup.py not using absolute_import
8 contrib/python-zstandard/setup.py not using absolute_import
8 contrib/python-zstandard/setup_zstd.py not using absolute_import
9 contrib/python-zstandard/setup_zstd.py not using absolute_import
9 contrib/python-zstandard/tests/common.py not using absolute_import
10 contrib/python-zstandard/tests/common.py not using absolute_import
10 contrib/python-zstandard/tests/test_buffer_util.py not using absolute_import
11 contrib/python-zstandard/tests/test_buffer_util.py not using absolute_import
11 contrib/python-zstandard/tests/test_compressor.py not using absolute_import
12 contrib/python-zstandard/tests/test_compressor.py not using absolute_import
12 contrib/python-zstandard/tests/test_compressor_fuzzing.py not using absolute_import
13 contrib/python-zstandard/tests/test_compressor_fuzzing.py not using absolute_import
13 contrib/python-zstandard/tests/test_data_structures.py not using absolute_import
14 contrib/python-zstandard/tests/test_data_structures.py not using absolute_import
14 contrib/python-zstandard/tests/test_data_structures_fuzzing.py not using absolute_import
15 contrib/python-zstandard/tests/test_data_structures_fuzzing.py not using absolute_import
15 contrib/python-zstandard/tests/test_decompressor.py not using absolute_import
16 contrib/python-zstandard/tests/test_decompressor.py not using absolute_import
16 contrib/python-zstandard/tests/test_decompressor_fuzzing.py not using absolute_import
17 contrib/python-zstandard/tests/test_decompressor_fuzzing.py not using absolute_import
17 contrib/python-zstandard/tests/test_estimate_sizes.py not using absolute_import
18 contrib/python-zstandard/tests/test_estimate_sizes.py not using absolute_import
18 contrib/python-zstandard/tests/test_module_attributes.py not using absolute_import
19 contrib/python-zstandard/tests/test_module_attributes.py not using absolute_import
19 contrib/python-zstandard/tests/test_train_dictionary.py not using absolute_import
20 contrib/python-zstandard/tests/test_train_dictionary.py not using absolute_import
20 i18n/check-translation.py not using absolute_import
21 i18n/check-translation.py not using absolute_import
21 setup.py not using absolute_import
22 setup.py not using absolute_import
22 tests/test-demandimport.py not using absolute_import
23 tests/test-demandimport.py not using absolute_import
23
24
24 #if py3exe
25 #if py3exe
25 $ syshg files 'set:(**.py) - grep(pygments)' -X hgext/fsmonitor/pywatchman \
26 $ testrepohg files 'set:(**.py) - grep(pygments)' \
27 > -X hgext/fsmonitor/pywatchman \
26 > | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py \
28 > | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py \
27 > | sed 's/[0-9][0-9]*)$/*)/'
29 > | sed 's/[0-9][0-9]*)$/*)/'
28 hgext/convert/transport.py: error importing: <*Error> No module named 'svn.client' (error at transport.py:*) (glob)
30 hgext/convert/transport.py: error importing: <*Error> No module named 'svn.client' (error at transport.py:*) (glob)
29 mercurial/cffi/bdiff.py: error importing: <ImportError> cannot import name '_bdiff' (error at bdiff.py:*)
31 mercurial/cffi/bdiff.py: error importing: <ImportError> cannot import name '_bdiff' (error at bdiff.py:*)
30 mercurial/cffi/bdiffbuild.py: error importing: <ImportError> No module named 'cffi' (error at bdiffbuild.py:*)
32 mercurial/cffi/bdiffbuild.py: error importing: <ImportError> No module named 'cffi' (error at bdiffbuild.py:*)
31 mercurial/cffi/mpatch.py: error importing: <ImportError> cannot import name '_mpatch' (error at mpatch.py:*)
33 mercurial/cffi/mpatch.py: error importing: <ImportError> cannot import name '_mpatch' (error at mpatch.py:*)
32 mercurial/cffi/mpatchbuild.py: error importing: <ImportError> No module named 'cffi' (error at mpatchbuild.py:*)
34 mercurial/cffi/mpatchbuild.py: error importing: <ImportError> No module named 'cffi' (error at mpatchbuild.py:*)
33 mercurial/cffi/osutilbuild.py: error importing: <ImportError> No module named 'cffi' (error at osutilbuild.py:*)
35 mercurial/cffi/osutilbuild.py: error importing: <ImportError> No module named 'cffi' (error at osutilbuild.py:*)
34 mercurial/scmwindows.py: error importing: <*Error> No module named 'msvcrt' (error at win32.py:*) (glob)
36 mercurial/scmwindows.py: error importing: <*Error> No module named 'msvcrt' (error at win32.py:*) (glob)
35 mercurial/win32.py: error importing: <*Error> No module named 'msvcrt' (error at win32.py:*) (glob)
37 mercurial/win32.py: error importing: <*Error> No module named 'msvcrt' (error at win32.py:*) (glob)
36 mercurial/windows.py: error importing: <*Error> No module named 'msvcrt' (error at windows.py:*) (glob)
38 mercurial/windows.py: error importing: <*Error> No module named 'msvcrt' (error at windows.py:*) (glob)
37
39
38 #endif
40 #endif
39
41
40 #if py3exe py3pygments
42 #if py3exe py3pygments
41 $ syshg files 'set:(**.py) and grep(pygments)' | sed 's|\\|/|g' \
43 $ testrepohg files 'set:(**.py) and grep(pygments)' | sed 's|\\|/|g' \
42 > | xargs $PYTHON3 contrib/check-py3-compat.py \
44 > | xargs $PYTHON3 contrib/check-py3-compat.py \
43 > | sed 's/[0-9][0-9]*)$/*)/'
45 > | sed 's/[0-9][0-9]*)$/*)/'
44 #endif
46 #endif
@@ -1,15 +1,15
1 #require test-repo pyflakes hg10
1 #require test-repo pyflakes hg10
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ cd "`dirname "$TESTDIR"`"
4 $ cd "`dirname "$TESTDIR"`"
5
5
6 run pyflakes on all tracked files ending in .py or without a file ending
6 run pyflakes on all tracked files ending in .py or without a file ending
7 (skipping binary file random-seed)
7 (skipping binary file random-seed)
8
8
9 $ syshg locate 'set:**.py or grep("^#!.*python")' \
9 $ testrepohg locate 'set:**.py or grep("^#!.*python")' \
10 > -X hgext/fsmonitor/pywatchman \
10 > -X hgext/fsmonitor/pywatchman \
11 > -X mercurial/pycompat.py -X contrib/python-zstandard \
11 > -X mercurial/pycompat.py -X contrib/python-zstandard \
12 > 2>/dev/null \
12 > 2>/dev/null \
13 > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
13 > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
14 tests/filterpyflakes.py:41: undefined name 'undefinedname'
14 tests/filterpyflakes.py:41: undefined name 'undefinedname'
15
15
@@ -1,25 +1,25
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ cd "`dirname "$TESTDIR"`"
4 $ cd "`dirname "$TESTDIR"`"
5
5
6 look for python scripts that do not use /usr/bin/env
6 look for python scripts that do not use /usr/bin/env
7
7
8 $ syshg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bi{1}n/env python") - **/*.t'
8 $ testrepohg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bi{1}n/env python") - **/*.t'
9 [1]
9 [1]
10
10
11 In tests, enforce $PYTHON and *not* /usr/bin/env python or similar:
11 In tests, enforce $PYTHON and *not* /usr/bin/env python or similar:
12 $ syshg files 'set:grep(r"#!.*?python") and **/*.t' \
12 $ testrepohg files 'set:grep(r"#!.*?python") and **/*.t' \
13 > -X tests/test-check-execute.t \
13 > -X tests/test-check-execute.t \
14 > -X tests/test-check-module-imports.t \
14 > -X tests/test-check-module-imports.t \
15 > -X tests/test-check-pyflakes.t \
15 > -X tests/test-check-pyflakes.t \
16 > -X tests/test-check-shbang.t
16 > -X tests/test-check-shbang.t
17 [1]
17 [1]
18
18
19 The above exclusions are because they're looking for files that
19 The above exclusions are because they're looking for files that
20 contain Python but don't end in .py - please avoid adding more.
20 contain Python but don't end in .py - please avoid adding more.
21
21
22 look for shell scripts that do not use /bin/sh
22 look for shell scripts that do not use /bin/sh
23
23
24 $ syshg files 'set:grep(r"^#!.*/bi{1}n/sh") and not grep(r"^#!/bi{1}n/sh")'
24 $ testrepohg files 'set:grep(r"^#!.*/bi{1}n/sh") and not grep(r"^#!/bi{1}n/sh")'
25 [1]
25 [1]
@@ -1,175 +1,175
1 #require test-repo
1 #require test-repo
2
2
3 Set vars:
3 Set vars:
4
4
5 $ . "$TESTDIR/helpers-testrepo.sh"
5 $ . "$TESTDIR/helpers-testrepo.sh"
6 $ CONTRIBDIR="$TESTDIR/../contrib"
6 $ CONTRIBDIR="$TESTDIR/../contrib"
7
7
8 Prepare repo:
8 Prepare repo:
9
9
10 $ hg init
10 $ hg init
11
11
12 $ echo this is file a > a
12 $ echo this is file a > a
13 $ hg add a
13 $ hg add a
14 $ hg commit -m first
14 $ hg commit -m first
15
15
16 $ echo adding to file a >> a
16 $ echo adding to file a >> a
17 $ hg commit -m second
17 $ hg commit -m second
18
18
19 $ echo adding more to file a >> a
19 $ echo adding more to file a >> a
20 $ hg commit -m third
20 $ hg commit -m third
21
21
22 $ hg up -r 0
22 $ hg up -r 0
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 $ echo merge-this >> a
24 $ echo merge-this >> a
25 $ hg commit -m merge-able
25 $ hg commit -m merge-able
26 created new head
26 created new head
27
27
28 $ hg up -r 2
28 $ hg up -r 2
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30
30
31 perfstatus
31 perfstatus
32
32
33 $ cat >> $HGRCPATH << EOF
33 $ cat >> $HGRCPATH << EOF
34 > [extensions]
34 > [extensions]
35 > perfstatusext=$CONTRIBDIR/perf.py
35 > perfstatusext=$CONTRIBDIR/perf.py
36 > [perf]
36 > [perf]
37 > presleep=0
37 > presleep=0
38 > stub=on
38 > stub=on
39 > parentscount=1
39 > parentscount=1
40 > EOF
40 > EOF
41 $ hg help perfstatusext
41 $ hg help perfstatusext
42 perfstatusext extension - helper extension to measure performance
42 perfstatusext extension - helper extension to measure performance
43
43
44 list of commands:
44 list of commands:
45
45
46 perfaddremove
46 perfaddremove
47 (no help text available)
47 (no help text available)
48 perfancestors
48 perfancestors
49 (no help text available)
49 (no help text available)
50 perfancestorset
50 perfancestorset
51 (no help text available)
51 (no help text available)
52 perfannotate (no help text available)
52 perfannotate (no help text available)
53 perfbdiff benchmark a bdiff between revisions
53 perfbdiff benchmark a bdiff between revisions
54 perfbookmarks
54 perfbookmarks
55 benchmark parsing bookmarks from disk to memory
55 benchmark parsing bookmarks from disk to memory
56 perfbranchmap
56 perfbranchmap
57 benchmark the update of a branchmap
57 benchmark the update of a branchmap
58 perfcca (no help text available)
58 perfcca (no help text available)
59 perfchangegroupchangelog
59 perfchangegroupchangelog
60 Benchmark producing a changelog group for a changegroup.
60 Benchmark producing a changelog group for a changegroup.
61 perfchangeset
61 perfchangeset
62 (no help text available)
62 (no help text available)
63 perfctxfiles (no help text available)
63 perfctxfiles (no help text available)
64 perfdiffwd Profile diff of working directory changes
64 perfdiffwd Profile diff of working directory changes
65 perfdirfoldmap
65 perfdirfoldmap
66 (no help text available)
66 (no help text available)
67 perfdirs (no help text available)
67 perfdirs (no help text available)
68 perfdirstate (no help text available)
68 perfdirstate (no help text available)
69 perfdirstatedirs
69 perfdirstatedirs
70 (no help text available)
70 (no help text available)
71 perfdirstatefoldmap
71 perfdirstatefoldmap
72 (no help text available)
72 (no help text available)
73 perfdirstatewrite
73 perfdirstatewrite
74 (no help text available)
74 (no help text available)
75 perffncacheencode
75 perffncacheencode
76 (no help text available)
76 (no help text available)
77 perffncacheload
77 perffncacheload
78 (no help text available)
78 (no help text available)
79 perffncachewrite
79 perffncachewrite
80 (no help text available)
80 (no help text available)
81 perfheads (no help text available)
81 perfheads (no help text available)
82 perfindex (no help text available)
82 perfindex (no help text available)
83 perfloadmarkers
83 perfloadmarkers
84 benchmark the time to parse the on-disk markers for a repo
84 benchmark the time to parse the on-disk markers for a repo
85 perflog (no help text available)
85 perflog (no help text available)
86 perflookup (no help text available)
86 perflookup (no help text available)
87 perflrucachedict
87 perflrucachedict
88 (no help text available)
88 (no help text available)
89 perfmanifest (no help text available)
89 perfmanifest (no help text available)
90 perfmergecalculate
90 perfmergecalculate
91 (no help text available)
91 (no help text available)
92 perfmoonwalk benchmark walking the changelog backwards
92 perfmoonwalk benchmark walking the changelog backwards
93 perfnodelookup
93 perfnodelookup
94 (no help text available)
94 (no help text available)
95 perfparents (no help text available)
95 perfparents (no help text available)
96 perfpathcopies
96 perfpathcopies
97 (no help text available)
97 (no help text available)
98 perfphases benchmark phasesets computation
98 perfphases benchmark phasesets computation
99 perfrawfiles (no help text available)
99 perfrawfiles (no help text available)
100 perfrevlogchunks
100 perfrevlogchunks
101 Benchmark operations on revlog chunks.
101 Benchmark operations on revlog chunks.
102 perfrevlogindex
102 perfrevlogindex
103 Benchmark operations against a revlog index.
103 Benchmark operations against a revlog index.
104 perfrevlogrevision
104 perfrevlogrevision
105 Benchmark obtaining a revlog revision.
105 Benchmark obtaining a revlog revision.
106 perfrevlogrevisions
106 perfrevlogrevisions
107 Benchmark reading a series of revisions from a revlog.
107 Benchmark reading a series of revisions from a revlog.
108 perfrevrange (no help text available)
108 perfrevrange (no help text available)
109 perfrevset benchmark the execution time of a revset
109 perfrevset benchmark the execution time of a revset
110 perfstartup (no help text available)
110 perfstartup (no help text available)
111 perfstatus (no help text available)
111 perfstatus (no help text available)
112 perftags (no help text available)
112 perftags (no help text available)
113 perftemplating
113 perftemplating
114 (no help text available)
114 (no help text available)
115 perfvolatilesets
115 perfvolatilesets
116 benchmark the computation of various volatile set
116 benchmark the computation of various volatile set
117 perfwalk (no help text available)
117 perfwalk (no help text available)
118 perfwrite microbenchmark ui.write
118 perfwrite microbenchmark ui.write
119
119
120 (use 'hg help -v perfstatusext' to show built-in aliases and global options)
120 (use 'hg help -v perfstatusext' to show built-in aliases and global options)
121 $ hg perfaddremove
121 $ hg perfaddremove
122 $ hg perfancestors
122 $ hg perfancestors
123 $ hg perfancestorset 2
123 $ hg perfancestorset 2
124 $ hg perfannotate a
124 $ hg perfannotate a
125 $ hg perfbdiff -c 1
125 $ hg perfbdiff -c 1
126 $ hg perfbdiff --alldata 1
126 $ hg perfbdiff --alldata 1
127 $ hg perfbookmarks
127 $ hg perfbookmarks
128 $ hg perfbranchmap
128 $ hg perfbranchmap
129 $ hg perfcca
129 $ hg perfcca
130 $ hg perfchangegroupchangelog
130 $ hg perfchangegroupchangelog
131 $ hg perfchangeset 2
131 $ hg perfchangeset 2
132 $ hg perfctxfiles 2
132 $ hg perfctxfiles 2
133 $ hg perfdiffwd
133 $ hg perfdiffwd
134 $ hg perfdirfoldmap
134 $ hg perfdirfoldmap
135 $ hg perfdirs
135 $ hg perfdirs
136 $ hg perfdirstate
136 $ hg perfdirstate
137 $ hg perfdirstatedirs
137 $ hg perfdirstatedirs
138 $ hg perfdirstatefoldmap
138 $ hg perfdirstatefoldmap
139 $ hg perfdirstatewrite
139 $ hg perfdirstatewrite
140 $ hg perffncacheencode
140 $ hg perffncacheencode
141 $ hg perffncacheload
141 $ hg perffncacheload
142 $ hg perffncachewrite
142 $ hg perffncachewrite
143 $ hg perfheads
143 $ hg perfheads
144 $ hg perfindex
144 $ hg perfindex
145 $ hg perfloadmarkers
145 $ hg perfloadmarkers
146 $ hg perflog
146 $ hg perflog
147 $ hg perflookup 2
147 $ hg perflookup 2
148 $ hg perflrucache
148 $ hg perflrucache
149 $ hg perfmanifest 2
149 $ hg perfmanifest 2
150 $ hg perfmergecalculate -r 3
150 $ hg perfmergecalculate -r 3
151 $ hg perfmoonwalk
151 $ hg perfmoonwalk
152 $ hg perfnodelookup 2
152 $ hg perfnodelookup 2
153 $ hg perfpathcopies 1 2
153 $ hg perfpathcopies 1 2
154 $ hg perfrawfiles 2
154 $ hg perfrawfiles 2
155 $ hg perfrevlogindex -c
155 $ hg perfrevlogindex -c
156 $ hg perfrevlogrevisions .hg/store/data/a.i
156 $ hg perfrevlogrevisions .hg/store/data/a.i
157 $ hg perfrevlogrevision -m 0
157 $ hg perfrevlogrevision -m 0
158 $ hg perfrevlogchunks -c
158 $ hg perfrevlogchunks -c
159 $ hg perfrevrange
159 $ hg perfrevrange
160 $ hg perfrevset 'all()'
160 $ hg perfrevset 'all()'
161 $ hg perfstartup
161 $ hg perfstartup
162 $ hg perfstatus
162 $ hg perfstatus
163 $ hg perftags
163 $ hg perftags
164 $ hg perftemplating
164 $ hg perftemplating
165 $ hg perfvolatilesets
165 $ hg perfvolatilesets
166 $ hg perfwalk
166 $ hg perfwalk
167 $ hg perfparents
167 $ hg perfparents
168
168
169 Check perf.py for historical portability
169 Check perf.py for historical portability
170
170
171 $ cd "$TESTDIR/.."
171 $ cd "$TESTDIR/.."
172
172
173 $ (syshg files -r 1.2 glob:mercurial/*.c glob:mercurial/*.py;
173 $ (testrepohg files -r 1.2 glob:mercurial/*.c glob:mercurial/*.py;
174 > syshg files -r tip glob:mercurial/*.c glob:mercurial/*.py) |
174 > testrepohg files -r tip glob:mercurial/*.c glob:mercurial/*.py) |
175 > "$TESTDIR"/check-perf-code.py contrib/perf.py
175 > "$TESTDIR"/check-perf-code.py contrib/perf.py
@@ -1,23 +1,23
1 #require test-repo slow debhelper
1 #require test-repo slow debhelper
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ syshgenv
4 $ testrepohgenv
5
5
6 Ensure debuild doesn't run the testsuite, as that could get silly.
6 Ensure debuild doesn't run the testsuite, as that could get silly.
7 $ DEB_BUILD_OPTIONS=nocheck
7 $ DEB_BUILD_OPTIONS=nocheck
8 $ export DEB_BUILD_OPTIONS
8 $ export DEB_BUILD_OPTIONS
9 $ OUTPUTDIR=`pwd`
9 $ OUTPUTDIR=`pwd`
10 $ export OUTPUTDIR
10 $ export OUTPUTDIR
11
11
12 $ cd "$TESTDIR"/..
12 $ cd "$TESTDIR"/..
13 $ make deb > $OUTPUTDIR/build.log 2>&1
13 $ make deb > $OUTPUTDIR/build.log 2>&1
14 $ cd $OUTPUTDIR
14 $ cd $OUTPUTDIR
15 $ ls *.deb
15 $ ls *.deb
16 mercurial-common_*.deb (glob)
16 mercurial-common_*.deb (glob)
17 mercurial_*.deb (glob)
17 mercurial_*.deb (glob)
18 main deb should have .so but no .py
18 main deb should have .so but no .py
19 $ dpkg --contents mercurial_*.deb | egrep '(localrepo|parsers)'
19 $ dpkg --contents mercurial_*.deb | egrep '(localrepo|parsers)'
20 * ./usr/lib/python2.7/dist-packages/mercurial/parsers*.so (glob)
20 * ./usr/lib/python2.7/dist-packages/mercurial/parsers*.so (glob)
21 mercurial-common should have py but no .so or pyc
21 mercurial-common should have py but no .so or pyc
22 $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers)'
22 $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers)'
23 * ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py (glob)
23 * ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py (glob)
@@ -1,31 +1,31
1 #require test-repo slow docker
1 #require test-repo slow docker
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ syshgenv
4 $ testrepohgenv
5
5
6 Ensure debuild doesn't run the testsuite, as that could get silly.
6 Ensure debuild doesn't run the testsuite, as that could get silly.
7 $ DEB_BUILD_OPTIONS=nocheck
7 $ DEB_BUILD_OPTIONS=nocheck
8 $ export DEB_BUILD_OPTIONS
8 $ export DEB_BUILD_OPTIONS
9 $ OUTPUTDIR=`pwd`
9 $ OUTPUTDIR=`pwd`
10 $ export OUTPUTDIR
10 $ export OUTPUTDIR
11
11
12 $ cd "$TESTDIR"/..
12 $ cd "$TESTDIR"/..
13 $ make docker-debian-jessie > $OUTPUTDIR/build.log 2>&1
13 $ make docker-debian-jessie > $OUTPUTDIR/build.log 2>&1
14 $ cd $OUTPUTDIR
14 $ cd $OUTPUTDIR
15 $ ls *.deb
15 $ ls *.deb
16 mercurial-common_*.deb (glob)
16 mercurial-common_*.deb (glob)
17 mercurial_*.deb (glob)
17 mercurial_*.deb (glob)
18
18
19 We check debian package contents with portable tools so that when
19 We check debian package contents with portable tools so that when
20 we're on non-debian machines we can still test the packages that are
20 we're on non-debian machines we can still test the packages that are
21 built using docker.
21 built using docker.
22
22
23 main deb should have .so but no .py
23 main deb should have .so but no .py
24 $ ar x mercurial_*.deb
24 $ ar x mercurial_*.deb
25 $ tar tf data.tar* | egrep '(localrepo|parsers)'
25 $ tar tf data.tar* | egrep '(localrepo|parsers)'
26 ./usr/lib/python2.7/dist-packages/mercurial/parsers*.so (glob)
26 ./usr/lib/python2.7/dist-packages/mercurial/parsers*.so (glob)
27 mercurial-common should have .py but no .so or .pyc
27 mercurial-common should have .py but no .so or .pyc
28 $ ar x mercurial-common_*.deb
28 $ ar x mercurial-common_*.deb
29 $ tar tf data.tar* | egrep '(localrepo|parsers)'
29 $ tar tf data.tar* | egrep '(localrepo|parsers)'
30 ./usr/lib/python2.7/dist-packages/mercurial/pure/parsers.py
30 ./usr/lib/python2.7/dist-packages/mercurial/pure/parsers.py
31 ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py
31 ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py
@@ -1,44 +1,44
1 $ . "$TESTDIR/helpers-testrepo.sh"
1 $ . "$TESTDIR/helpers-testrepo.sh"
2
2
3 Testing that hghave does not crash when checking features
3 Testing that hghave does not crash when checking features
4
4
5 $ hghave --test-features 2>/dev/null
5 $ hghave --test-features 2>/dev/null
6
6
7 Testing hghave extensibility for third party tools
7 Testing hghave extensibility for third party tools
8
8
9 $ cat > hghaveaddon.py <<EOF
9 $ cat > hghaveaddon.py <<EOF
10 > import hghave
10 > import hghave
11 > @hghave.check("custom", "custom hghave feature")
11 > @hghave.check("custom", "custom hghave feature")
12 > def has_custom():
12 > def has_custom():
13 > return True
13 > return True
14 > EOF
14 > EOF
15
15
16 (invocation via run-tests.py)
16 (invocation via run-tests.py)
17
17
18 $ cat > test-hghaveaddon.t <<EOF
18 $ cat > test-hghaveaddon.t <<EOF
19 > #require custom
19 > #require custom
20 > $ echo foo
20 > $ echo foo
21 > foo
21 > foo
22 > EOF
22 > EOF
23 $ ( \
23 $ ( \
24 > syshgenv; \
24 > testrepohgenv; \
25 > $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \
25 > $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \
26 > )
26 > )
27 .
27 .
28 # Ran 1 tests, 0 skipped, 0 failed.
28 # Ran 1 tests, 0 skipped, 0 failed.
29
29
30 (invocation via command line)
30 (invocation via command line)
31
31
32 $ unset TESTDIR
32 $ unset TESTDIR
33 $ hghave custom
33 $ hghave custom
34
34
35 (terminate with exit code 2 at failure of importing hghaveaddon.py)
35 (terminate with exit code 2 at failure of importing hghaveaddon.py)
36
36
37 $ rm hghaveaddon.*
37 $ rm hghaveaddon.*
38 $ cat > hghaveaddon.py <<EOF
38 $ cat > hghaveaddon.py <<EOF
39 > importing this file should cause syntax error
39 > importing this file should cause syntax error
40 > EOF
40 > EOF
41
41
42 $ hghave custom
42 $ hghave custom
43 failed to import hghaveaddon.py from '.': invalid syntax (hghaveaddon.py, line 1)
43 failed to import hghaveaddon.py from '.': invalid syntax (hghaveaddon.py, line 1)
44 [2]
44 [2]
@@ -1,147 +1,147
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ syshgenv
4 $ testrepohgenv
5 $ import_checker="$TESTDIR"/../contrib/import-checker.py
5 $ import_checker="$TESTDIR"/../contrib/import-checker.py
6
6
7 Run the doctests from the import checker, and make sure
7 Run the doctests from the import checker, and make sure
8 it's working correctly.
8 it's working correctly.
9 $ TERM=dumb
9 $ TERM=dumb
10 $ export TERM
10 $ export TERM
11 $ python -m doctest $import_checker
11 $ python -m doctest $import_checker
12
12
13 Run additional tests for the import checker
13 Run additional tests for the import checker
14
14
15 $ mkdir testpackage
15 $ mkdir testpackage
16 $ touch testpackage/__init__.py
16 $ touch testpackage/__init__.py
17
17
18 $ cat > testpackage/multiple.py << EOF
18 $ cat > testpackage/multiple.py << EOF
19 > from __future__ import absolute_import
19 > from __future__ import absolute_import
20 > import os, sys
20 > import os, sys
21 > EOF
21 > EOF
22
22
23 $ cat > testpackage/unsorted.py << EOF
23 $ cat > testpackage/unsorted.py << EOF
24 > from __future__ import absolute_import
24 > from __future__ import absolute_import
25 > import sys
25 > import sys
26 > import os
26 > import os
27 > EOF
27 > EOF
28
28
29 $ cat > testpackage/stdafterlocal.py << EOF
29 $ cat > testpackage/stdafterlocal.py << EOF
30 > from __future__ import absolute_import
30 > from __future__ import absolute_import
31 > from . import unsorted
31 > from . import unsorted
32 > import os
32 > import os
33 > EOF
33 > EOF
34
34
35 $ cat > testpackage/requirerelative.py << EOF
35 $ cat > testpackage/requirerelative.py << EOF
36 > from __future__ import absolute_import
36 > from __future__ import absolute_import
37 > import testpackage.unsorted
37 > import testpackage.unsorted
38 > EOF
38 > EOF
39
39
40 $ cat > testpackage/importalias.py << EOF
40 $ cat > testpackage/importalias.py << EOF
41 > from __future__ import absolute_import
41 > from __future__ import absolute_import
42 > import ui
42 > import ui
43 > EOF
43 > EOF
44
44
45 $ cat > testpackage/relativestdlib.py << EOF
45 $ cat > testpackage/relativestdlib.py << EOF
46 > from __future__ import absolute_import
46 > from __future__ import absolute_import
47 > from .. import os
47 > from .. import os
48 > EOF
48 > EOF
49
49
50 $ cat > testpackage/symbolimport.py << EOF
50 $ cat > testpackage/symbolimport.py << EOF
51 > from __future__ import absolute_import
51 > from __future__ import absolute_import
52 > from .unsorted import foo
52 > from .unsorted import foo
53 > EOF
53 > EOF
54
54
55 $ cat > testpackage/latesymbolimport.py << EOF
55 $ cat > testpackage/latesymbolimport.py << EOF
56 > from __future__ import absolute_import
56 > from __future__ import absolute_import
57 > from . import unsorted
57 > from . import unsorted
58 > from mercurial.node import hex
58 > from mercurial.node import hex
59 > EOF
59 > EOF
60
60
61 $ cat > testpackage/multiplegroups.py << EOF
61 $ cat > testpackage/multiplegroups.py << EOF
62 > from __future__ import absolute_import
62 > from __future__ import absolute_import
63 > from . import unsorted
63 > from . import unsorted
64 > from . import more
64 > from . import more
65 > EOF
65 > EOF
66
66
67 $ mkdir testpackage/subpackage
67 $ mkdir testpackage/subpackage
68 $ cat > testpackage/subpackage/levelpriority.py << EOF
68 $ cat > testpackage/subpackage/levelpriority.py << EOF
69 > from __future__ import absolute_import
69 > from __future__ import absolute_import
70 > from . import foo
70 > from . import foo
71 > from .. import parent
71 > from .. import parent
72 > EOF
72 > EOF
73
73
74 $ touch testpackage/subpackage/foo.py
74 $ touch testpackage/subpackage/foo.py
75 $ cat > testpackage/subpackage/__init__.py << EOF
75 $ cat > testpackage/subpackage/__init__.py << EOF
76 > from __future__ import absolute_import
76 > from __future__ import absolute_import
77 > from . import levelpriority # should not cause cycle
77 > from . import levelpriority # should not cause cycle
78 > EOF
78 > EOF
79
79
80 $ cat > testpackage/subpackage/localimport.py << EOF
80 $ cat > testpackage/subpackage/localimport.py << EOF
81 > from __future__ import absolute_import
81 > from __future__ import absolute_import
82 > from . import foo
82 > from . import foo
83 > def bar():
83 > def bar():
84 > # should not cause "higher-level import should come first"
84 > # should not cause "higher-level import should come first"
85 > from .. import unsorted
85 > from .. import unsorted
86 > # but other errors should be detected
86 > # but other errors should be detected
87 > from .. import more
87 > from .. import more
88 > import testpackage.subpackage.levelpriority
88 > import testpackage.subpackage.levelpriority
89 > EOF
89 > EOF
90
90
91 $ cat > testpackage/importmodulefromsub.py << EOF
91 $ cat > testpackage/importmodulefromsub.py << EOF
92 > from __future__ import absolute_import
92 > from __future__ import absolute_import
93 > from .subpackage import foo # not a "direct symbol import"
93 > from .subpackage import foo # not a "direct symbol import"
94 > EOF
94 > EOF
95
95
96 $ cat > testpackage/importsymbolfromsub.py << EOF
96 $ cat > testpackage/importsymbolfromsub.py << EOF
97 > from __future__ import absolute_import
97 > from __future__ import absolute_import
98 > from .subpackage import foo, nonmodule
98 > from .subpackage import foo, nonmodule
99 > EOF
99 > EOF
100
100
101 $ cat > testpackage/sortedentries.py << EOF
101 $ cat > testpackage/sortedentries.py << EOF
102 > from __future__ import absolute_import
102 > from __future__ import absolute_import
103 > from . import (
103 > from . import (
104 > foo,
104 > foo,
105 > bar,
105 > bar,
106 > )
106 > )
107 > EOF
107 > EOF
108
108
109 $ cat > testpackage/importfromalias.py << EOF
109 $ cat > testpackage/importfromalias.py << EOF
110 > from __future__ import absolute_import
110 > from __future__ import absolute_import
111 > from . import ui
111 > from . import ui
112 > EOF
112 > EOF
113
113
114 $ cat > testpackage/importfromrelative.py << EOF
114 $ cat > testpackage/importfromrelative.py << EOF
115 > from __future__ import absolute_import
115 > from __future__ import absolute_import
116 > from testpackage.unsorted import foo
116 > from testpackage.unsorted import foo
117 > EOF
117 > EOF
118
118
119 $ mkdir testpackage2
119 $ mkdir testpackage2
120 $ touch testpackage2/__init__.py
120 $ touch testpackage2/__init__.py
121
121
122 $ cat > testpackage2/latesymbolimport.py << EOF
122 $ cat > testpackage2/latesymbolimport.py << EOF
123 > from __future__ import absolute_import
123 > from __future__ import absolute_import
124 > from testpackage import unsorted
124 > from testpackage import unsorted
125 > from mercurial.node import hex
125 > from mercurial.node import hex
126 > EOF
126 > EOF
127
127
128 $ $PYTHON "$import_checker" testpackage*/*.py testpackage/subpackage/*.py
128 $ $PYTHON "$import_checker" testpackage*/*.py testpackage/subpackage/*.py
129 testpackage/importalias.py:2: ui module must be "as" aliased to uimod
129 testpackage/importalias.py:2: ui module must be "as" aliased to uimod
130 testpackage/importfromalias.py:2: ui from testpackage must be "as" aliased to uimod
130 testpackage/importfromalias.py:2: ui from testpackage must be "as" aliased to uimod
131 testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted
131 testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted
132 testpackage/importfromrelative.py:2: direct symbol import foo from testpackage.unsorted
132 testpackage/importfromrelative.py:2: direct symbol import foo from testpackage.unsorted
133 testpackage/importsymbolfromsub.py:2: direct symbol import nonmodule from testpackage.subpackage
133 testpackage/importsymbolfromsub.py:2: direct symbol import nonmodule from testpackage.subpackage
134 testpackage/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node
134 testpackage/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node
135 testpackage/multiple.py:2: multiple imported names: os, sys
135 testpackage/multiple.py:2: multiple imported names: os, sys
136 testpackage/multiplegroups.py:3: multiple "from . import" statements
136 testpackage/multiplegroups.py:3: multiple "from . import" statements
137 testpackage/relativestdlib.py:2: relative import of stdlib module
137 testpackage/relativestdlib.py:2: relative import of stdlib module
138 testpackage/requirerelative.py:2: import should be relative: testpackage.unsorted
138 testpackage/requirerelative.py:2: import should be relative: testpackage.unsorted
139 testpackage/sortedentries.py:2: imports from testpackage not lexically sorted: bar < foo
139 testpackage/sortedentries.py:2: imports from testpackage not lexically sorted: bar < foo
140 testpackage/stdafterlocal.py:3: stdlib import "os" follows local import: testpackage
140 testpackage/stdafterlocal.py:3: stdlib import "os" follows local import: testpackage
141 testpackage/subpackage/levelpriority.py:3: higher-level import should come first: testpackage
141 testpackage/subpackage/levelpriority.py:3: higher-level import should come first: testpackage
142 testpackage/subpackage/localimport.py:7: multiple "from .. import" statements
142 testpackage/subpackage/localimport.py:7: multiple "from .. import" statements
143 testpackage/subpackage/localimport.py:8: import should be relative: testpackage.subpackage.levelpriority
143 testpackage/subpackage/localimport.py:8: import should be relative: testpackage.subpackage.levelpriority
144 testpackage/symbolimport.py:2: direct symbol import foo from testpackage.unsorted
144 testpackage/symbolimport.py:2: direct symbol import foo from testpackage.unsorted
145 testpackage/unsorted.py:3: imports not lexically sorted: os < sys
145 testpackage/unsorted.py:3: imports not lexically sorted: os < sys
146 testpackage2/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node
146 testpackage2/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node
147 [1]
147 [1]
@@ -1,212 +1,212
1 hg debuginstall
1 hg debuginstall
2 $ hg debuginstall
2 $ hg debuginstall
3 checking encoding (ascii)...
3 checking encoding (ascii)...
4 checking Python executable (*) (glob)
4 checking Python executable (*) (glob)
5 checking Python version (2.*) (glob)
5 checking Python version (2.*) (glob)
6 checking Python lib (*lib*)... (glob)
6 checking Python lib (*lib*)... (glob)
7 checking Python security support (*) (glob)
7 checking Python security support (*) (glob)
8 TLS 1.2 not supported by Python install; network connections lack modern security (?)
8 TLS 1.2 not supported by Python install; network connections lack modern security (?)
9 SNI not supported by Python install; may have connectivity issues with some servers (?)
9 SNI not supported by Python install; may have connectivity issues with some servers (?)
10 checking Mercurial version (*) (glob)
10 checking Mercurial version (*) (glob)
11 checking Mercurial custom build (*) (glob)
11 checking Mercurial custom build (*) (glob)
12 checking module policy (*) (glob)
12 checking module policy (*) (glob)
13 checking installed modules (*mercurial)... (glob)
13 checking installed modules (*mercurial)... (glob)
14 checking registered compression engines (*zlib*) (glob)
14 checking registered compression engines (*zlib*) (glob)
15 checking available compression engines (*zlib*) (glob)
15 checking available compression engines (*zlib*) (glob)
16 checking available compression engines for wire protocol (*zlib*) (glob)
16 checking available compression engines for wire protocol (*zlib*) (glob)
17 checking templates (*mercurial?templates)... (glob)
17 checking templates (*mercurial?templates)... (glob)
18 checking default template (*mercurial?templates?map-cmdline.default) (glob)
18 checking default template (*mercurial?templates?map-cmdline.default) (glob)
19 checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
19 checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
20 checking username (test)
20 checking username (test)
21 no problems detected
21 no problems detected
22
22
23 hg debuginstall JSON
23 hg debuginstall JSON
24 $ hg debuginstall -Tjson | sed 's|\\\\|\\|g'
24 $ hg debuginstall -Tjson | sed 's|\\\\|\\|g'
25 [
25 [
26 {
26 {
27 "compengines": ["bz2", "bz2truncated", "none", "zlib"*], (glob)
27 "compengines": ["bz2", "bz2truncated", "none", "zlib"*], (glob)
28 "compenginesavail": ["bz2", "bz2truncated", "none", "zlib"*], (glob)
28 "compenginesavail": ["bz2", "bz2truncated", "none", "zlib"*], (glob)
29 "compenginesserver": [*"zlib"*], (glob)
29 "compenginesserver": [*"zlib"*], (glob)
30 "defaulttemplate": "*mercurial?templates?map-cmdline.default", (glob)
30 "defaulttemplate": "*mercurial?templates?map-cmdline.default", (glob)
31 "defaulttemplateerror": null,
31 "defaulttemplateerror": null,
32 "defaulttemplatenotfound": "default",
32 "defaulttemplatenotfound": "default",
33 "editor": "* -c \"import sys; sys.exit(0)\"", (glob)
33 "editor": "* -c \"import sys; sys.exit(0)\"", (glob)
34 "editornotfound": false,
34 "editornotfound": false,
35 "encoding": "ascii",
35 "encoding": "ascii",
36 "encodingerror": null,
36 "encodingerror": null,
37 "extensionserror": null, (no-pure !)
37 "extensionserror": null, (no-pure !)
38 "hgmodulepolicy": "*", (glob)
38 "hgmodulepolicy": "*", (glob)
39 "hgmodules": "*mercurial", (glob)
39 "hgmodules": "*mercurial", (glob)
40 "hgver": "*", (glob)
40 "hgver": "*", (glob)
41 "hgverextra": "*", (glob)
41 "hgverextra": "*", (glob)
42 "problems": 0,
42 "problems": 0,
43 "pythonexe": "*", (glob)
43 "pythonexe": "*", (glob)
44 "pythonlib": "*", (glob)
44 "pythonlib": "*", (glob)
45 "pythonsecurity": [*], (glob)
45 "pythonsecurity": [*], (glob)
46 "pythonver": "*.*.*", (glob)
46 "pythonver": "*.*.*", (glob)
47 "templatedirs": "*mercurial?templates", (glob)
47 "templatedirs": "*mercurial?templates", (glob)
48 "username": "test",
48 "username": "test",
49 "usernameerror": null,
49 "usernameerror": null,
50 "vinotfound": false
50 "vinotfound": false
51 }
51 }
52 ]
52 ]
53
53
54 hg debuginstall with no username
54 hg debuginstall with no username
55 $ HGUSER= hg debuginstall
55 $ HGUSER= hg debuginstall
56 checking encoding (ascii)...
56 checking encoding (ascii)...
57 checking Python executable (*) (glob)
57 checking Python executable (*) (glob)
58 checking Python version (2.*) (glob)
58 checking Python version (2.*) (glob)
59 checking Python lib (*lib*)... (glob)
59 checking Python lib (*lib*)... (glob)
60 checking Python security support (*) (glob)
60 checking Python security support (*) (glob)
61 TLS 1.2 not supported by Python install; network connections lack modern security (?)
61 TLS 1.2 not supported by Python install; network connections lack modern security (?)
62 SNI not supported by Python install; may have connectivity issues with some servers (?)
62 SNI not supported by Python install; may have connectivity issues with some servers (?)
63 checking Mercurial version (*) (glob)
63 checking Mercurial version (*) (glob)
64 checking Mercurial custom build (*) (glob)
64 checking Mercurial custom build (*) (glob)
65 checking module policy (*) (glob)
65 checking module policy (*) (glob)
66 checking installed modules (*mercurial)... (glob)
66 checking installed modules (*mercurial)... (glob)
67 checking registered compression engines (*zlib*) (glob)
67 checking registered compression engines (*zlib*) (glob)
68 checking available compression engines (*zlib*) (glob)
68 checking available compression engines (*zlib*) (glob)
69 checking available compression engines for wire protocol (*zlib*) (glob)
69 checking available compression engines for wire protocol (*zlib*) (glob)
70 checking templates (*mercurial?templates)... (glob)
70 checking templates (*mercurial?templates)... (glob)
71 checking default template (*mercurial?templates?map-cmdline.default) (glob)
71 checking default template (*mercurial?templates?map-cmdline.default) (glob)
72 checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
72 checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
73 checking username...
73 checking username...
74 no username supplied
74 no username supplied
75 (specify a username in your configuration file)
75 (specify a username in your configuration file)
76 1 problems detected, please check your install!
76 1 problems detected, please check your install!
77 [1]
77 [1]
78
78
79 path variables are expanded (~ is the same as $TESTTMP)
79 path variables are expanded (~ is the same as $TESTTMP)
80 $ mkdir tools
80 $ mkdir tools
81 $ touch tools/testeditor.exe
81 $ touch tools/testeditor.exe
82 #if execbit
82 #if execbit
83 $ chmod 755 tools/testeditor.exe
83 $ chmod 755 tools/testeditor.exe
84 #endif
84 #endif
85 $ hg debuginstall --config ui.editor=~/tools/testeditor.exe
85 $ hg debuginstall --config ui.editor=~/tools/testeditor.exe
86 checking encoding (ascii)...
86 checking encoding (ascii)...
87 checking Python executable (*) (glob)
87 checking Python executable (*) (glob)
88 checking Python version (*) (glob)
88 checking Python version (*) (glob)
89 checking Python lib (*lib*)... (glob)
89 checking Python lib (*lib*)... (glob)
90 checking Python security support (*) (glob)
90 checking Python security support (*) (glob)
91 TLS 1.2 not supported by Python install; network connections lack modern security (?)
91 TLS 1.2 not supported by Python install; network connections lack modern security (?)
92 SNI not supported by Python install; may have connectivity issues with some servers (?)
92 SNI not supported by Python install; may have connectivity issues with some servers (?)
93 checking Mercurial version (*) (glob)
93 checking Mercurial version (*) (glob)
94 checking Mercurial custom build (*) (glob)
94 checking Mercurial custom build (*) (glob)
95 checking module policy (*) (glob)
95 checking module policy (*) (glob)
96 checking installed modules (*mercurial)... (glob)
96 checking installed modules (*mercurial)... (glob)
97 checking registered compression engines (*zlib*) (glob)
97 checking registered compression engines (*zlib*) (glob)
98 checking available compression engines (*zlib*) (glob)
98 checking available compression engines (*zlib*) (glob)
99 checking available compression engines for wire protocol (*zlib*) (glob)
99 checking available compression engines for wire protocol (*zlib*) (glob)
100 checking templates (*mercurial?templates)... (glob)
100 checking templates (*mercurial?templates)... (glob)
101 checking default template (*mercurial?templates?map-cmdline.default) (glob)
101 checking default template (*mercurial?templates?map-cmdline.default) (glob)
102 checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
102 checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
103 checking username (test)
103 checking username (test)
104 no problems detected
104 no problems detected
105
105
106 #if test-repo
106 #if test-repo
107 $ . "$TESTDIR/helpers-testrepo.sh"
107 $ . "$TESTDIR/helpers-testrepo.sh"
108
108
109 $ cat >> wixxml.py << EOF
109 $ cat >> wixxml.py << EOF
110 > import os, subprocess, sys
110 > import os, subprocess, sys
111 > import xml.etree.ElementTree as ET
111 > import xml.etree.ElementTree as ET
112 >
112 >
113 > # MSYS mangles the path if it expands $TESTDIR
113 > # MSYS mangles the path if it expands $TESTDIR
114 > testdir = os.environ['TESTDIR']
114 > testdir = os.environ['TESTDIR']
115 > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
115 > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
116 >
116 >
117 > def directory(node, relpath):
117 > def directory(node, relpath):
118 > '''generator of files in the xml node, rooted at relpath'''
118 > '''generator of files in the xml node, rooted at relpath'''
119 > dirs = node.findall('./{%(wix)s}Directory' % ns)
119 > dirs = node.findall('./{%(wix)s}Directory' % ns)
120 >
120 >
121 > for d in dirs:
121 > for d in dirs:
122 > for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
122 > for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
123 > yield subfile
123 > yield subfile
124 >
124 >
125 > files = node.findall('./{%(wix)s}Component/{%(wix)s}File' % ns)
125 > files = node.findall('./{%(wix)s}Component/{%(wix)s}File' % ns)
126 >
126 >
127 > for f in files:
127 > for f in files:
128 > yield relpath + f.attrib['Name']
128 > yield relpath + f.attrib['Name']
129 >
129 >
130 > def hgdirectory(relpath):
130 > def hgdirectory(relpath):
131 > '''generator of tracked files, rooted at relpath'''
131 > '''generator of tracked files, rooted at relpath'''
132 > hgdir = "%s/../mercurial" % (testdir)
132 > hgdir = "%s/../mercurial" % (testdir)
133 > args = ['hg', '--cwd', hgdir, 'files', relpath]
133 > args = ['hg', '--cwd', hgdir, 'files', relpath]
134 > proc = subprocess.Popen(args, stdout=subprocess.PIPE,
134 > proc = subprocess.Popen(args, stdout=subprocess.PIPE,
135 > stderr=subprocess.PIPE)
135 > stderr=subprocess.PIPE)
136 > output = proc.communicate()[0]
136 > output = proc.communicate()[0]
137 >
137 >
138 > slash = '/'
138 > slash = '/'
139 > for line in output.splitlines():
139 > for line in output.splitlines():
140 > if os.name == 'nt':
140 > if os.name == 'nt':
141 > yield line.replace(os.sep, slash)
141 > yield line.replace(os.sep, slash)
142 > else:
142 > else:
143 > yield line
143 > yield line
144 >
144 >
145 > tracked = [f for f in hgdirectory(sys.argv[1])]
145 > tracked = [f for f in hgdirectory(sys.argv[1])]
146 >
146 >
147 > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
147 > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
148 > root = xml.getroot()
148 > root = xml.getroot()
149 > dir = root.find('.//{%(wix)s}DirectoryRef' % ns)
149 > dir = root.find('.//{%(wix)s}DirectoryRef' % ns)
150 >
150 >
151 > installed = [f for f in directory(dir, '')]
151 > installed = [f for f in directory(dir, '')]
152 >
152 >
153 > print('Not installed:')
153 > print('Not installed:')
154 > for f in sorted(set(tracked) - set(installed)):
154 > for f in sorted(set(tracked) - set(installed)):
155 > print(' %s' % f)
155 > print(' %s' % f)
156 >
156 >
157 > print('Not tracked:')
157 > print('Not tracked:')
158 > for f in sorted(set(installed) - set(tracked)):
158 > for f in sorted(set(installed) - set(tracked)):
159 > print(' %s' % f)
159 > print(' %s' % f)
160 > EOF
160 > EOF
161
161
162 $ (syshgenv; $PYTHON wixxml.py help )
162 $ ( testrepohgenv; $PYTHON wixxml.py help )
163 Not installed:
163 Not installed:
164 help/common.txt
164 help/common.txt
165 help/hg-ssh.8.txt
165 help/hg-ssh.8.txt
166 help/hg.1.txt
166 help/hg.1.txt
167 help/hgignore.5.txt
167 help/hgignore.5.txt
168 help/hgrc.5.txt
168 help/hgrc.5.txt
169 Not tracked:
169 Not tracked:
170
170
171 $ ( syshgenv; $PYTHON wixxml.py templates )
171 $ ( testrepohgenv; $PYTHON wixxml.py templates )
172 Not installed:
172 Not installed:
173 Not tracked:
173 Not tracked:
174
174
175 #endif
175 #endif
176
176
177 #if virtualenv
177 #if virtualenv
178
178
179 Verify that Mercurial is installable with pip. Note that this MUST be
179 Verify that Mercurial is installable with pip. Note that this MUST be
180 the last test in this file, because we do some nasty things to the
180 the last test in this file, because we do some nasty things to the
181 shell environment in order to make the virtualenv work reliably.
181 shell environment in order to make the virtualenv work reliably.
182
182
183 $ cd $TESTTMP
183 $ cd $TESTTMP
184 Note: --no-site-packages is deprecated, but some places have an
184 Note: --no-site-packages is deprecated, but some places have an
185 ancient virtualenv from their linux distro or similar and it's not yet
185 ancient virtualenv from their linux distro or similar and it's not yet
186 the default for them.
186 the default for them.
187 $ unset PYTHONPATH
187 $ unset PYTHONPATH
188 $ $PYTHON -m virtualenv --no-site-packages --never-download installenv >> pip.log
188 $ $PYTHON -m virtualenv --no-site-packages --never-download installenv >> pip.log
189 Note: we use this weird path to run pip and hg to avoid platform differences,
189 Note: we use this weird path to run pip and hg to avoid platform differences,
190 since it's bin on most platforms but Scripts on Windows.
190 since it's bin on most platforms but Scripts on Windows.
191 $ ./installenv/*/pip install --no-index $TESTDIR/.. >> pip.log
191 $ ./installenv/*/pip install --no-index $TESTDIR/.. >> pip.log
192 $ ./installenv/*/hg debuginstall || cat pip.log
192 $ ./installenv/*/hg debuginstall || cat pip.log
193 checking encoding (ascii)...
193 checking encoding (ascii)...
194 checking Python executable (*) (glob)
194 checking Python executable (*) (glob)
195 checking Python version (2.*) (glob)
195 checking Python version (2.*) (glob)
196 checking Python lib (*)... (glob)
196 checking Python lib (*)... (glob)
197 checking Python security support (*) (glob)
197 checking Python security support (*) (glob)
198 TLS 1.2 not supported by Python install; network connections lack modern security (?)
198 TLS 1.2 not supported by Python install; network connections lack modern security (?)
199 SNI not supported by Python install; may have connectivity issues with some servers (?)
199 SNI not supported by Python install; may have connectivity issues with some servers (?)
200 checking Mercurial version (*) (glob)
200 checking Mercurial version (*) (glob)
201 checking Mercurial custom build (*) (glob)
201 checking Mercurial custom build (*) (glob)
202 checking module policy (*) (glob)
202 checking module policy (*) (glob)
203 checking installed modules (*/mercurial)... (glob)
203 checking installed modules (*/mercurial)... (glob)
204 checking registered compression engines (*) (glob)
204 checking registered compression engines (*) (glob)
205 checking available compression engines (*) (glob)
205 checking available compression engines (*) (glob)
206 checking available compression engines for wire protocol (*) (glob)
206 checking available compression engines for wire protocol (*) (glob)
207 checking templates ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob)
207 checking templates ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob)
208 checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob)
208 checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob)
209 checking commit editor... (*) (glob)
209 checking commit editor... (*) (glob)
210 checking username (test)
210 checking username (test)
211 no problems detected
211 no problems detected
212 #endif
212 #endif
@@ -1,64 +1,64
1 #require test-repo slow osx osxpackaging
1 #require test-repo slow osx osxpackaging
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ syshgenv
4 $ testrepohgenv
5
5
6 $ OUTPUTDIR="`pwd`"
6 $ OUTPUTDIR="`pwd`"
7 $ export OUTPUTDIR
7 $ export OUTPUTDIR
8 $ KEEPMPKG=yes
8 $ KEEPMPKG=yes
9 $ export KEEPMPKG
9 $ export KEEPMPKG
10
10
11 $ cd "$TESTDIR"/..
11 $ cd "$TESTDIR"/..
12 $ make osx > "$OUTPUTDIR/build.log" 2>&1
12 $ make osx > "$OUTPUTDIR/build.log" 2>&1
13 $ cd "$OUTPUTDIR"
13 $ cd "$OUTPUTDIR"
14 $ ls -d *.pkg
14 $ ls -d *.pkg
15 Mercurial-*-macosx10.*.pkg (glob)
15 Mercurial-*-macosx10.*.pkg (glob)
16
16
17 $ xar -xf Mercurial*.pkg
17 $ xar -xf Mercurial*.pkg
18
18
19 Gather list of all installed files:
19 Gather list of all installed files:
20 $ lsbom mercurial.pkg/Bom > boms.txt
20 $ lsbom mercurial.pkg/Bom > boms.txt
21
21
22 We've had problems with the filter logic in the past. Make sure no
22 We've had problems with the filter logic in the past. Make sure no
23 .DS_Store files ended up in the final package:
23 .DS_Store files ended up in the final package:
24 $ grep DS_S boms.txt
24 $ grep DS_S boms.txt
25 [1]
25 [1]
26
26
27 Spot-check some randomly selected files:
27 Spot-check some randomly selected files:
28 $ grep bdiff boms.txt | cut -d ' ' -f 1,2,3
28 $ grep bdiff boms.txt | cut -d ' ' -f 1,2,3
29 ./Library/Python/2.7/site-packages/mercurial/cext/bdiff.so 100755 0/0
29 ./Library/Python/2.7/site-packages/mercurial/cext/bdiff.so 100755 0/0
30 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.py 100644 0/0
30 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.py 100644 0/0
31 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyc 100644 0/0
31 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyc 100644 0/0
32 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyo 100644 0/0
32 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyo 100644 0/0
33 $ grep zsh/site-functions/_hg boms.txt | cut -d ' ' -f 1,2,3
33 $ grep zsh/site-functions/_hg boms.txt | cut -d ' ' -f 1,2,3
34 ./usr/local/share/zsh/site-functions/_hg 100644 0/0
34 ./usr/local/share/zsh/site-functions/_hg 100644 0/0
35 $ grep hg-completion.bash boms.txt | cut -d ' ' -f 1,2,3
35 $ grep hg-completion.bash boms.txt | cut -d ' ' -f 1,2,3
36 ./usr/local/hg/contrib/hg-completion.bash 100644 0/0
36 ./usr/local/hg/contrib/hg-completion.bash 100644 0/0
37 $ egrep 'man[15]' boms.txt | cut -d ' ' -f 1,2,3
37 $ egrep 'man[15]' boms.txt | cut -d ' ' -f 1,2,3
38 ./usr/local/share/man/man1 40755 0/0
38 ./usr/local/share/man/man1 40755 0/0
39 ./usr/local/share/man/man1/chg.1 100644 0/0
39 ./usr/local/share/man/man1/chg.1 100644 0/0
40 ./usr/local/share/man/man1/hg.1 100644 0/0
40 ./usr/local/share/man/man1/hg.1 100644 0/0
41 ./usr/local/share/man/man5 40755 0/0
41 ./usr/local/share/man/man5 40755 0/0
42 ./usr/local/share/man/man5/hgignore.5 100644 0/0
42 ./usr/local/share/man/man5/hgignore.5 100644 0/0
43 ./usr/local/share/man/man5/hgrc.5 100644 0/0
43 ./usr/local/share/man/man5/hgrc.5 100644 0/0
44 $ grep bser boms.txt | cut -d ' ' -f 1,2,3
44 $ grep bser boms.txt | cut -d ' ' -f 1,2,3
45 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/bser.so 100755 0/0
45 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/bser.so 100755 0/0
46 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.py 100644 0/0
46 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.py 100644 0/0
47 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyc 100644 0/0
47 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyc 100644 0/0
48 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyo 100644 0/0
48 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyo 100644 0/0
49 $ grep localrepo boms.txt | cut -d ' ' -f 1,2,3
49 $ grep localrepo boms.txt | cut -d ' ' -f 1,2,3
50 ./Library/Python/2.7/site-packages/mercurial/localrepo.py 100644 0/0
50 ./Library/Python/2.7/site-packages/mercurial/localrepo.py 100644 0/0
51 ./Library/Python/2.7/site-packages/mercurial/localrepo.pyc 100644 0/0
51 ./Library/Python/2.7/site-packages/mercurial/localrepo.pyc 100644 0/0
52 ./Library/Python/2.7/site-packages/mercurial/localrepo.pyo 100644 0/0
52 ./Library/Python/2.7/site-packages/mercurial/localrepo.pyo 100644 0/0
53 $ egrep 'bin/' boms.txt | cut -d ' ' -f 1,2,3
53 $ egrep 'bin/' boms.txt | cut -d ' ' -f 1,2,3
54 ./usr/local/bin/chg 100755 0/0
54 ./usr/local/bin/chg 100755 0/0
55 ./usr/local/bin/hg 100755 0/0
55 ./usr/local/bin/hg 100755 0/0
56
56
57 Make sure the built binary uses the system Python interpreter
57 Make sure the built binary uses the system Python interpreter
58 $ bsdtar xf mercurial.pkg/Payload usr/local/bin
58 $ bsdtar xf mercurial.pkg/Payload usr/local/bin
59 Use a glob to find this to avoid check-code whining about a fixed path.
59 Use a glob to find this to avoid check-code whining about a fixed path.
60 $ head -n 1 usr/local/b?n/hg
60 $ head -n 1 usr/local/b?n/hg
61 #!/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
61 #!/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
62
62
63 Note that we're not currently installing any /etc/mercurial stuff,
63 Note that we're not currently installing any /etc/mercurial stuff,
64 including merge-tool configurations.
64 including merge-tool configurations.
General Comments 0
You need to be logged in to leave comments. Login now