[PATCH] run-tests: print diff to stderr instead to stdout
simohe at besonet.ch
Tue Feb 11 02:22:52 CST 2014
--On 2014-02-10 17:24 -0600 Matt Mackall <mpm at selenic.com> wrote:
> On Mon, 2014-02-10 at 14:27 +0100, Simon Heimberg wrote:
>> # HG changeset patch
>> # User Simon Heimberg <simohe at besonet.ch>
>> # Date 1391878137 -3600
>> # Node ID 12df27e151f1d72a180ab1e40222a9d88110e096
>> # Parent 289c3b0e73da58ed81a0be54956034437572b98d
>> run-tests: print diff to stderr instead to stdout
> This will make people (like me) who do 'run-tests | less' sad, which
> seems to counter the marginal goodness of this patch. Perhaps we can
> post-process this in some fashion.
Right. Myself too. Of course we could use 2>&1 at the end. But I would
often forget it.
We could post-process it on buildbot, when logging or when displaying. But
I do not have a buildbot installation. If we go in this direction, we
probably should public the master buildbot configuration somewhere (tracked
>> On buildbot, this has the advantage that the diff output is colured red.
>> This visual structuring makes the result easier to read.
>> diff -r 289c3b0e73da -r 12df27e151f1 tests/run-tests.py
>> --- a/tests/run-tests.py Sam Feb 08 10:41:17 2014 +0100
>> +++ b/tests/run-tests.py Sam Feb 08 17:48:57 2014 +0100
>> @@ -299,9 +299,10 @@
>> return missing, failed
>> def showdiff(expected, output, ref, err):
>> - print
>> + sys.stderr.write('\n')
>> for line in difflib.unified_diff(expected, output, ref, err):
>> - sys.stdout.write(line)
>> + sys.stderr.write(line)
>> + sys.stderr.flush()
>> verbose = False
>> def vlog(*msg):
>> Mercurial-devel mailing list
>> Mercurial-devel at selenic.com
> Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel