##// END OF EJS Templates
revlog: subclass the new `repository.iverifyproblem` Protocol class...
revlog: subclass the new `repository.iverifyproblem` Protocol class This is the same transformation as 3a90a6fd710d did for dirstate, but the CamelCase naming was already cleaned up here. We shouldn't have to explicitly subclass, but I'm doing so to test the interplay of regular attributes and the `attrs` class. Also, PyCharm has a nifty feature that puts a jump point in the gutter to navigate back and forth between the base class and subclasses (and override functions and base class functions) when there's an explicit subclassing. Additionally, PyCharm will immediately flag signature mismatches without a 40m pytype run.

File last commit:

r52878:2924676d default
r53365:4ef6dbc2 default
Show More
seq.py
31 lines | 578 B | text/x-python | PythonLexer
Gregory Szorc
global: use python3 in shebangs...
r46434 #!/usr/bin/env python3
Matt Harbison
tests: introduce 'seq.py' as a portable replacement for 'seq'...
r24360 #
# A portable replacement for 'seq'
#
# Usage:
# seq STOP [1, STOP] stepping by 1
# seq START STOP [START, STOP] stepping by 1
# seq START STEP STOP [START, STOP] stepping by STEP
Matt Harbison
tests: force `seq` to print with '\n' EOL...
r52878 import io
Matt Harbison
tests: introduce 'seq.py' as a portable replacement for 'seq'...
r24360 import sys
Matt Harbison
tests: force `seq` to print with '\n' EOL...
r52878 sys.stdout = io.TextIOWrapper(
sys.stdout.buffer,
sys.stdout.encoding,
sys.stdout.errors,
newline="\n",
)
Matt Harbison
tests: apply binary mode to output in seq.py...
r40809
Matt Harbison
tests: introduce 'seq.py' as a portable replacement for 'seq'...
r24360 start = 1
if len(sys.argv) > 2:
start = int(sys.argv[1])
step = 1
if len(sys.argv) > 3:
step = int(sys.argv[2])
stop = int(sys.argv[-1]) + 1
Manuel Jacob
py3: remove xrange() compatibility code...
r50180 for i in range(start, stop, step):
Robert Stanca
py3: use print_function in seq.py
r28722 print(i)