Author: rhuijben
Date: Thu Jul 7 11:50:17 2011
New Revision: 1143778
URL: http://svn.apache.org/viewvc?rev=1143778&view=rev
Log:
Instead of disowning the blame streams just to be able to close them ourselves,
directly pass them to make the standard delta handler do this work for us.
* subversion/libsvn_client/blame.c
(delta_baton): Remove streams.
(window_handler): Remove close code.
(file_rev_handler): Pass the real streams to svn_txdelta_apply.
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=1143778&r1=1143777&r2=1143778&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/blame.c (original)
+++ subversion/trunk/subversion/libsvn_client/blame.c Thu Jul 7 11:50:17 2011
@@ -107,8 +107,6 @@ 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 */
- svn_stream_t *stream; /* the result of the delta */
const char *filename;
};
@@ -321,14 +319,6 @@ window_handler(svn_txdelta_window_t *win
if (window)
return SVN_NO_ERROR;
- /* Close the files 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));
- SVN_ERR(svn_stream_close(dbaton->stream));
-
/* If we are including merged revisions, we need to add each rev to the
merged chain. */
if (frb->include_merged_revisions)
@@ -455,24 +445,20 @@ file_rev_handler(void *baton, const char
/* Prepare the text delta window handler. */
if (frb->last_filename)
- SVN_ERR(svn_stream_open_readonly(&delta_baton->source_stream,
frb->last_filename,
+ SVN_ERR(svn_stream_open_readonly(&last_stream, frb->last_filename,
frb->currpool, pool));
else
/* Means empty stream below. */
- delta_baton->source_stream = NULL;
- last_stream = svn_stream_disown(delta_baton->source_stream, pool);
+ last_stream = NULL;
if (frb->include_merged_revisions && !frb->merged_revision)
filepool = frb->filepool;
else
filepool = frb->currpool;
- SVN_ERR(svn_stream_open_unique(&delta_baton->stream,
- &delta_baton->filename,
- NULL,
+ SVN_ERR(svn_stream_open_unique(&cur_stream, &delta_baton->filename, NULL,
svn_io_file_del_on_pool_cleanup,
filepool, filepool));
- cur_stream = svn_stream_disown(delta_baton->stream, filepool);
/* Get window handler for applying delta. */
svn_txdelta_apply(last_stream, cur_stream, NULL, NULL,