comparison tests/test-check-execute.t @ 33116:6c113a7dec52

tests: use the system hg for examining the local repository Most test scripts use "hg" to interact with a temporary test repository. However a few tests also want to run hg commands to interact with the local repository containing the mercurial source code. Notably, many of the test-check-* tests want to check local files and commit messages. These tests were previously using the version of hg being tested to query the source repository. However, this will fail if the source repository requires extensions or other settings not supported by the version of mercurial being tested. The source repository was typically initially cloned using the system hg installation, so we should use the system hg installation to query it. There was already a helpers-testrepo.sh script designed to help cope with different requirements for the source repository versus the test repositories. However, it only handled the evolve extension. This new behavior works with any extensions that are different between the system installation and the test installation.
author Adam Simpkins <simpkins@fb.com>
date Tue, 27 Jun 2017 17:24:31 -0700
parents 3c9066ed557c
children ddd65b4f3ae6
comparison
equal deleted inserted replaced
33115:fa9a90d5ad89 33116:6c113a7dec52
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 $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' 8 $ syshg 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 $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' 13 $ syshg 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 $ hg files 'set:**.sh and exec() and not grep(r"^#!.*(ba)?sh")' 18 $ syshg 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 $ hg files 'set:exec() and not **.sh and not **.py and not grep(r"^#!")' 23 $ syshg files 'set:exec() and not **.sh and not **.py and not grep(r"^#!")'
24 [1] 24 [1]