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

Re: svn diff segfault

From: Vladimir Prus <ghost_at_cs.msu.su>
Date: 2002-01-18 11:55:30 CET

cmpilato@collab.net wrote:

> Technically, we don't
> require tests to accompany a patch, but I can't think of a better way
> to impress a development community than to say, "Here's a bug fix...and
> here's my proof!"

I'm of the same mind.
Updated patch follows:

Log message:
The 'diff' command no longer crashes when two revisions of a file differ in
properties but not in text.

* subversion/libsvn_client/repos_diff.c
  
  (close_file): Check for presense of any change to report was added.

* subversion/tests/clients/cmdline/diff_tests.py

  (diff_only_property_change): New function.

Patch:
Index: ./subversion/libsvn_client/repos_diff.c
===================================================================
--- ./subversion/libsvn_client/repos_diff.c
+++ ./subversion/libsvn_client/repos_diff.c Fri Jan 18 13:00:08 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);
 
Index: ./subversion/tests/clients/cmdline/diff_tests.py
===================================================================
--- ./subversion/tests/clients/cmdline/diff_tests.py
+++ ./subversion/tests/clients/cmdline/diff_tests.py Fri Jan 18 12:55:46 2002
@@ -547,6 +547,32 @@
 
   return 0
   
+def diff_only_property_change(sbox):
+ "diff when property was changed but text was not"
+
+ if sbox.build():
+ return 1
+
+ wc_dir = sbox.wc_dir
+
+ current_dir = os.getcwd();
+ os.chdir(sbox.wc_dir);
+
+ svntest.main.run_svn(None, 'propset', 'svn:eol-style', 'none', "iota")
+ svntest.main.run_svn(None, 'ci')
+
+ result = 0
+
+ if os.system(svntest.main.svn_binary + " diff -r1:2"):
+ result = 1
+
+ if not result and os.system(svntest.main.svn_binary + " diff -r2:1"):
+ result = 1
+
+ os.chdir(current_dir)
+ return result
+
+
 
 ########################################################################
 # Run the tests
@@ -562,6 +588,7 @@
               diff_non_recursive,
               diff_repo_subset,
               diff_non_version_controlled_file,
+ diff_only_property_change,
              ]
 
 if __name__ == '__main__':

Note: svntest.main.run_svn provides to way to detect segfault. I've found
nothing appropriate, so have used plain os.system.

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:57 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.