[PATCH] run-tests: print diff to stderr instead to stdout

Matt Mackall mpm at selenic.com
Mon Feb 10 17:24:15 CST 2014


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.

> 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
> http://selenic.com/mailman/listinfo/mercurial-devel

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list