summaryrefslogtreecommitdiff
path: root/subversion/libsvn_wc/deprecated.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_wc/deprecated.c')
-rw-r--r--subversion/libsvn_wc/deprecated.c46
1 files changed, 38 insertions, 8 deletions
diff --git a/subversion/libsvn_wc/deprecated.c b/subversion/libsvn_wc/deprecated.c
index dcb5e42f749be..e54a86df903b0 100644
--- a/subversion/libsvn_wc/deprecated.c
+++ b/subversion/libsvn_wc/deprecated.c
@@ -39,6 +39,7 @@
#include "private/svn_subr_private.h"
#include "private/svn_wc_private.h"
+#include "private/svn_io_private.h"
#include "wc.h"
#include "entries.h"
@@ -478,20 +479,49 @@ svn_wc_transmit_text_deltas2(const char **tempfile,
const char *local_abspath;
svn_wc_context_t *wc_ctx;
const svn_checksum_t *new_text_base_md5_checksum;
+ svn_stream_t *tempstream;
+ svn_error_t *err;
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL /* config */,
svn_wc__adm_get_db(adm_access),
pool));
+ if (tempfile)
+ {
+ apr_file_t *f;
+
+ /* The temporary file can't be the same location as in 1.6 because the
+ * admin directory no longer exists. */
+ SVN_ERR(svn_io_open_unique_file3(&f, tempfile, NULL,
+ svn_io_file_del_none,
+ pool, pool));
+ tempstream = svn_stream__from_aprfile(f, FALSE, TRUE, pool);
+ }
+ else
+ {
+ tempstream = NULL;
+ }
+
+ err = svn_wc__internal_transmit_text_deltas(svn_stream_disown(tempstream, pool),
+ (digest
+ ? &new_text_base_md5_checksum
+ : NULL),
+ NULL, wc_ctx->db,
+ local_abspath, fulltext,
+ editor, file_baton,
+ pool, pool);
+ if (tempfile)
+ {
+ err = svn_error_compose_create(err, svn_stream_close(tempstream));
+
+ if (err)
+ {
+ err = svn_error_compose_create(
+ err, svn_io_remove_file2(*tempfile, TRUE, pool));
+ }
+ }
- SVN_ERR(svn_wc__internal_transmit_text_deltas(tempfile,
- (digest
- ? &new_text_base_md5_checksum
- : NULL),
- NULL, wc_ctx->db,
- local_abspath, fulltext,
- editor, file_baton,
- pool, pool));
+ SVN_ERR(err);
if (digest)
memcpy(digest, new_text_base_md5_checksum->digest, APR_MD5_DIGESTSIZE);