tests/filtercr.py
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
Wed, 11 Jan 2012 15:53:42 -0500
changeset 15894 44fa047cef57
parent 13141 6cfe17c19ba2
permissions -rwxr-xr-x
merge: report all files in _checkunknown When doing hg up, if there is a file conflict with untracked files, currently only the first such conflict is reported. With this patch, all of them are listed. With this patch error message is now reported as a: untracked file differs b: untracked file differs abort: untracked files in working directory conflict with files in requested revision instead of abort: untracked file in working directory differs from file in requested revision: 'a' This is a follow up to an old attempt to do this here: http://selenic.com/pipermail/mercurial-devel/2011-August/033625.html

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