tests/filtercr.py
author Thomas Arendsen Hein <thomas@intevation.de>
Thu, 05 May 2011 16:01:09 +0200
branchstable
changeset 14205 7b627923739f
parent 13141 6cfe17c19ba2
permissions -rwxr-xr-x
subrepo: use code from 71ea5b2b9517 only if Python needs it (issue2795) With Python >= 2.6 the original code already works correct, therefore the fix for issue2556 on Python <= 2.5 broke relative subrepositories with newer versions of Python.

#!/usr/bin/env python

# Filter output by the progress extension to make it readable in tests

import sys, re

for line in sys.stdin:
    line = re.sub(r'\r+[^\n]', lambda m: '\n' + m.group()[-1:], line)
    sys.stdout.write(line)
print