tests/filtercr.py
author Patrick Mezard <pmezard@gmail.com>
Thu, 19 May 2011 22:44:01 +0200
changeset 14385 7709cc983025
parent 13141 6cfe17c19ba2
permissions -rwxr-xr-x
patch: git metadata was ignored if strip > 1 gitpatch objects emitted by iterhunks() are modified in place by applydiff(). Processing them earlier improves iterhunks() isolation. applydiff() modifying them should still be fixed though.

#!/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