diff options
Diffstat (limited to 'subversion/libsvn_delta/compat.c')
-rw-r--r-- | subversion/libsvn_delta/compat.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/subversion/libsvn_delta/compat.c b/subversion/libsvn_delta/compat.c index dfa97437b92d4..c89e9367cd370 100644 --- a/subversion/libsvn_delta/compat.c +++ b/subversion/libsvn_delta/compat.c @@ -816,8 +816,9 @@ static svn_error_t * open_delta_target(svn_stream_t **stream, void *baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool) { - const char **delta_target = baton; - return svn_stream_open_unique(stream, delta_target, NULL, + struct change_node *change = baton; + return svn_stream_open_unique(stream, &change->contents_abspath, + NULL, svn_io_file_del_on_pool_cleanup, result_pool, scratch_pool); } @@ -850,8 +851,7 @@ ev2_apply_textdelta(void *file_baton, FALSE, handler_pool); change->contents_changed = TRUE; - target = svn_stream_lazyopen_create(open_delta_target, - &change->contents_abspath, + target = svn_stream_lazyopen_create(open_delta_target, change, FALSE, fb->eb->edit_pool); svn_txdelta_apply(hb->source, target, @@ -1223,15 +1223,23 @@ alter_file_cb(void *baton, apr_pool_t *scratch_pool) { struct editor_baton *eb = baton; - const char *tmp_filename; svn_stream_t *tmp_stream; - svn_checksum_t *md5_checksum; struct change_node *change = insert_change(relpath, eb->changes); + /* Note: this node may already have information in CHANGE as a result + of an earlier copy/move operation. */ + /* ### should we verify the kind is truly a file? */ + change->kind = svn_node_file; + change->changing = revision; + if (props != NULL) + change->props = svn_prop_hash_dup(props, eb->edit_pool); if (contents) { + const char *tmp_filename; + svn_checksum_t *md5_checksum; + /* We may need to re-checksum these contents */ if (checksum && checksum->kind == svn_checksum_md5) md5_checksum = (svn_checksum_t *)checksum; @@ -1246,17 +1254,7 @@ alter_file_cb(void *baton, eb->edit_pool, scratch_pool)); SVN_ERR(svn_stream_copy3(contents, tmp_stream, NULL, NULL, scratch_pool)); - } - /* Note: this node may already have information in CHANGE as a result - of an earlier copy/move operation. */ - - change->kind = svn_node_file; - change->changing = revision; - if (props != NULL) - change->props = svn_prop_hash_dup(props, eb->edit_pool); - if (contents != NULL) - { change->contents_changed = TRUE; change->contents_abspath = tmp_filename; change->checksum = svn_checksum_dup(md5_checksum, eb->edit_pool); |