[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH v2] Make display_lines output a diff

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 26 Jul 2010 16:05:23 +0200

On Mon, Jul 26, 2010 at 07:07:12PM +0530, Ramkumar Ramachandra wrote:
> [[[
> * subversion/tests/cmdline/svntest/verify.py
> (display_lines): Additionally print unified diff output using Python
> difflib.unified_diff.
> ]]]

+1

>
> Index: subversion/tests/cmdline/svntest/verify.py
> ===================================================================
> --- subversion/tests/cmdline/svntest/verify.py (revision 979269)
> +++ subversion/tests/cmdline/svntest/verify.py (working copy)
> @@ -25,6 +25,7 @@
> ######################################################################
>
> import re, sys
> +from difflib import unified_diff
>
> import svntest
>
> @@ -292,6 +293,12 @@ def display_lines(message, label, expected, actual
> for x in actual:
> sys.stdout.write(x)
>
> + # Additionally print unified diff
> + print('DIFF ' + ' '.join(output.split(' ')[1:]))
> + for x in unified_diff(expected, actual,
> + fromfile="EXPECTED", tofile="ACTUAL"):
> + sys.stdout.write(x)
> +
> def compare_and_display_lines(message, label, expected, actual,
> raisable=None):
> """Compare two sets of output lines, and print them if they differ,

-- 
printf("Eh???/n");
Received on 2010-07-26 16:06:07 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.