[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: Ramkumar Ramachandra <artagnon_at_gmail.com>
Date: Mon, 26 Jul 2010 19:07:12 +0530

[[[
* subversion/tests/cmdline/svntest/verify.py
  (display_lines): Additionally print unified diff output using Python
  difflib.unified_diff.
]]]

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,
Received on 2010-07-26 15:39:42 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.