tests/filtercr.py
author Javi Merino <cibervicho@gmail.com>
Sat, 05 Feb 2011 13:59:34 +0000
changeset 13344 6367459decf7
parent 13141 6cfe17c19ba2
permissions -rwxr-xr-x
doc: Add back quotes around filenames Filenames starting with a dot (.hg and .hgignore) confuse man when creating the ps documentation with "man -t hg >hg.ps" if they are not enclosed in back quotes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13141
6cfe17c19ba2 tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     1
#!/usr/bin/env python
6cfe17c19ba2 tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     2
6cfe17c19ba2 tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     3
# Filter output by the progress extension to make it readable in tests
6cfe17c19ba2 tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     4
6cfe17c19ba2 tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     5
import sys, re
6cfe17c19ba2 tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     6
6cfe17c19ba2 tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     7
for line in sys.stdin:
6cfe17c19ba2 tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     8
    line = re.sub(r'\r+[^\n]', lambda m: '\n' + m.group()[-1:], line)
6cfe17c19ba2 tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     9
    sys.stdout.write(line)
6cfe17c19ba2 tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    10
print