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

[Vladimir Prus <ghost@cs.msu.su>] Re: svn diff segfault

From: <cmpilato_at_collab.net>
Date: 2002-01-21 15:27:25 CET

Sheesh, I almost lost this mail. Vladimir, please be sure in the
future to send patches to the whole dev-list.

------- Start of forwarded message -------
Content-Type: text/plain;
  charset="koi8-r"
From: Vladimir Prus <ghost@cs.msu.su>
To: cmpilato@collab.net
Subject: Re: svn diff segfault
Date: Fri, 18 Jan 2002 13:13:41 +0300
References: <E16R8pa-0000um-00@zigzag.cs.msu.su> <x7g055c7t6.fsf@pascal.ch.collab.net>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Message-Id: <E16RW1m-00061F-00@zigzag.cs.msu.su>

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

------- End of forwarded message -------

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