tests/filtercr.py
author Matt Mackall <mpm@selenic.com>
Sun, 16 Oct 2011 20:26:20 -0500
branchstable
changeset 15281 aeeb2afcdc25
parent 13141 6cfe17c19ba2
permissions -rwxr-xr-x
check-code: support multiline matches like try/except/finally - match one pattern at a time against entire file - find line containing match - sort matches by line number

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