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

Re: flaw in python bindings diff?

From: <cmpilato_at_collab.net>
Date: 2003-01-27 17:31:22 CET

Michael Kefeder mike@weird-birds.org writes:

 Hi
 
 In the end i tracked it down to the diff -L flag viewcvs uses to label
 the temporary files. viewcvs creates a label string that looks like
 Filename\tdate\trevision. And that label (at least on my machine
 with diff 2.7.2) causes trouble.
 
 The reason lies either in viewcvs or in subversions python
 bindings.

I made the bindings use that type of label because that's what rcsdiff
uses for CVS stuffs. And ViewCVS works fine for CVS files with
spaces.

 Where i'd like to vote for the svn-bindings. Because i think there's
 a flaw within fs.py in FileDiff::get_pipe(). The diffoptions (passed
 to FileDiff constructor) are string.split() which can result into
 strange behaviour because split() uses all whitespace characters for
 splitting if not told otherwise.

Ah...looks like Greg Stein busted this when he converted to popen2 in
revision 4343 (strangely enough because he claimed it fixed diffs on
files with spaces in them). Greg, can you help out a bit here?

   Various updates to the FileDiff class.
   
   * bindings/swig/python/svn/fs.py:
     (FileDiff.either_binary): new method to detect whether either file
       is a binary file, thus indicating whether the diff should be skipped
     (FileDiff.get_pipe): use a list for the diff command, along with the
       popen2 module (rather than os.popen). this avoids the shell for
       security purposes, and allows spaces in file names.
     (FileDiff.__del__): ignore errors while trying to remove the files.

 One workaround i can think of is using a non-whitespace
 param-string-separator (like | but that is a bit clumsy)

Nono. It just makes sense to have the output remain consistent with
rcsdiff's. We just need the right magic to do it.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 14 02:19:43 2006

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.