Mercurial > public > mercurial-scm > hg-stable
diff tests/filtercr.py @ 13141:6cfe17c19ba2
tests: add filtercr.py helper for progress tests
The two tests that used filtercr.py already used a slightly different
version, which explains why test-convert-svn-move.t changed after
switching to using $TESTDIR/filtercr.py.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Wed, 15 Dec 2010 16:29:46 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/filtercr.py Wed Dec 15 16:29:46 2010 +0100 @@ -0,0 +1,10 @@ +#!/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