subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1493272 - /subversion/trunk/subversion/libsvn_client/blame.c
Date Fri, 14 Jun 2013 22:43:09 GMT
Author: rhuijben
Date: Fri Jun 14 22:43:09 2013
New Revision: 1493272

URL: http://svn.apache.org/r1493272
Log:
Revert r1446177, which tweaked the closing time of a blame stream.

This patch caused a huge performance regression in some specific configuration
triggered by the SharpSvn build.

It also makes it clearer where we stop using the stream to help in applying the
performance improvements I discussed today with jcorvel around reusing files
instead of creating a tempfile for every new revision.

* subversion/libsvn_client/blame.c
  (delta_baton):
  (window_handler):
  (file_rev_handler):
    Revert r1446177.

Modified:
    subversion/trunk/subversion/libsvn_client/blame.c

Modified: subversion/trunk/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/blame.c?rev=1493272&r1=1493271&r2=1493272&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/blame.c (original)
+++ subversion/trunk/subversion/libsvn_client/blame.c Fri Jun 14 22:43:09 2013
@@ -106,6 +106,7 @@ struct delta_baton {
   svn_txdelta_window_handler_t wrapped_handler;
   void *wrapped_baton;
   struct file_rev_baton *file_rev_baton;
+  svn_stream_t *source_stream;  /* the delta source */
   const char *filename;
 };
 
@@ -325,6 +326,13 @@ window_handler(svn_txdelta_window_t *win
   if (window)
     return SVN_NO_ERROR;
 
+  /* Close the source file used for the delta.
+     It is important to do this early, since otherwise, they will be deleted
+     before all handles are closed, which leads to failures on some platforms
+     when new tempfiles are to be created. */
+  if (dbaton->source_stream)
+    SVN_ERR(svn_stream_close(dbaton->source_stream));
+
   /* If we are including merged revisions, we need to add each rev to the
      merged chain. */
   if (frb->include_merged_revisions)
@@ -438,10 +446,12 @@ file_rev_handler(void *baton, const char
 
   /* Prepare the text delta window handler. */
   if (frb->last_filename)
-    SVN_ERR(svn_stream_open_readonly(&last_stream, frb->last_filename,
+    SVN_ERR(svn_stream_open_readonly(&delta_baton->source_stream, frb->last_filename,
                                      frb->currpool, pool));
   else
-    last_stream = svn_stream_empty(frb->currpool);
+    /* Means empty stream below. */
+    delta_baton->source_stream = NULL;
+  last_stream = svn_stream_disown(delta_baton->source_stream, pool);
 
   if (frb->include_merged_revisions && !frb->merged_revision)
     filepool = frb->filepool;
@@ -450,7 +460,7 @@ file_rev_handler(void *baton, const char
 
   SVN_ERR(svn_stream_open_unique(&cur_stream, &delta_baton->filename, NULL,
                                  svn_io_file_del_on_pool_cleanup,
-                                 filepool, pool));
+                                 filepool, filepool));
 
   /* Get window handler for applying delta. */
   svn_txdelta_apply(last_stream, cur_stream, NULL, NULL,



Mime
View raw message