Mercurial > hg
annotate tests/seq.py @ 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 | 2cd8c3b0bd11 |
children | 08b8b56bd2e8 |
rev | line source |
---|---|
24360
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
2 # |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
3 # A portable replacement for 'seq' |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
4 # |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
5 # Usage: |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
6 # seq STOP [1, STOP] stepping by 1 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
7 # seq START STOP [START, STOP] stepping by 1 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
8 # seq START STEP STOP [START, STOP] stepping by STEP |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
9 |
28722
2cd8c3b0bd11
py3: use print_function in seq.py
Robert Stanca <robert.stanca7@gmail.com>
parents:
28721
diff
changeset
|
10 from __future__ import absolute_import, print_function |
24360
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
11 import sys |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
12 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
13 start = 1 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
14 if len(sys.argv) > 2: |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
15 start = int(sys.argv[1]) |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
16 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
17 step = 1 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
18 if len(sys.argv) > 3: |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
19 step = int(sys.argv[2]) |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
20 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
21 stop = int(sys.argv[-1]) + 1 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
22 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
23 for i in xrange(start, stop, step): |
28722
2cd8c3b0bd11
py3: use print_function in seq.py
Robert Stanca <robert.stanca7@gmail.com>
parents:
28721
diff
changeset
|
24 print(i) |