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

flaw in python bindings diff?

From: <mike_at_weird-birds.org>
Date: 2003-01-25 17:37:07 CET

Hi

Today i went through viewcvs code to figure out why the heck diffing
doesn't work for me. It works for http://www.linux1394.org so i thought it
must work for me too.

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. 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. Now when I pass the string '-L my file_label' to FileDiff then
split() would create an array [-L, \my, file_label\] which is a
incorrect parameter-list for popen2.popen2() to call diff.

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

Another one is to accept a list object instead of string as argument to the
constructor of FileDiff to pass the diff-params

or to create an intelligent cmd-param parser to split the params ;)

What do you think?

Oh, i almost forgot - i run svn 0.17.0 r4468 server from tarball and a
recent checkout of viewcvs-1.0dev with python 2.2

Yours
 Mike

---------------------------------------------------------------------
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:17:39 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.