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

svn diff segfault

From: Vladimir Prus <ghost_at_cs.msu.su>
Date: 2002-01-17 10:27:34 CET

Hi,
the command sequence below results in crash (svn revision 912 is used)

svnadmin create /tmp/svn
mkdir /tmp/z
echo "foo" > /tmp/z/file
svn import file://localhost/tmp/svn /tmp/z z
rm -rf /tmp/z
cd /tmp
svn co file://localhost/tmp/svn/z
cd z
svn propset svn:eol-style none file
svn ci
svn diff -r1:2 file

It looks like the problem is that diff command is not prepared to handle
difference only in file properties, without any textdelta. The patch below
seems to fix the problem and doesn't breaks any existing diff tests. Shall I
sumbit log message and tests for this case, or the way I deal with the
problem is not the right one (maybe, it would be more pure to have a flag
telling if a file should be diffed, instead of using b->path_end_revision for
that?)

Index: ./subversion/libsvn_client/repos_diff.c
===================================================================
--- ./subversion/libsvn_client/repos_diff.c
+++ ./subversion/libsvn_client/repos_diff.c Thu Jan 17 12:04:20 2002
@@ -568,7 +568,10 @@
 {
   struct file_baton *b = file_baton;
 
- SVN_ERR (run_diff_cmd (b));
+ // It is possible to have only change to properties, without texdelta
+ // In this case no difference should be reported and no need to run diff.
  
+ if (b->path_end_revision)
+ SVN_ERR (run_diff_cmd (b));
 
   svn_pool_destroy (b->pool);
 
Regards,
Vladimir

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:56 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.