Mercurial > hg
annotate tests/seq.py @ 38763:33ac6a72308a stable 4.7
revlog: fix descendant deprecated method
Fix the descendant deprecated method introduced earlier in this cycle.
This was caught by Yuya, thank you.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 01 Aug 2018 10:23:48 +0200 |
parents | 08b8b56bd2e8 |
children | 0605726179a0 |
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 |
35150
08b8b56bd2e8
py3: alias xrange to range in tests/seq.py
Pulkit Goyal <7895pulkit@gmail.com>
parents:
28722
diff
changeset
|
13 if sys.version_info[0] >= 3: |
08b8b56bd2e8
py3: alias xrange to range in tests/seq.py
Pulkit Goyal <7895pulkit@gmail.com>
parents:
28722
diff
changeset
|
14 xrange = range |
08b8b56bd2e8
py3: alias xrange to range in tests/seq.py
Pulkit Goyal <7895pulkit@gmail.com>
parents:
28722
diff
changeset
|
15 |
24360
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
16 start = 1 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
17 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
|
18 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
|
19 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
20 step = 1 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
21 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
|
22 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
|
23 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
24 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
|
25 |
f554f89a2038
tests: introduce 'seq.py' as a portable replacement for 'seq'
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
26 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
|
27 print(i) |