Author: kotkov
Date: Mon Nov 21 14:54:38 2022
New Revision: 1905435

URL: http://svn.apache.org/viewvc?rev=1905435&view=rev
Log:
Fix an asymmetry in the svn_txdelta_apply() API where among the source
and target streams it would only close the target stream.

The new API version, svn_txdelta_apply2(), closes both source and
target streams when the window handler is given a null window to signal
the end of the delta.  If the closure is not desired, the caller can use
svn_stream_disown() to protect either or both of the streams from being
closed, similarly to svn_stream_copy3().

This changeset switches to the new API on all calling sites, but keeps the
old behavior by using svn_stream_disown() for the source streams.  There are
some cases where this currently means that we keep the source stream open
longer than necessary, I plan to handle them separately.

* subversion/include/svn_delta.h
  (svn_txdelta_apply2): New, revved from …
  (svn_txdelta_apply): …this function, which is now deprecated.

* subversion/libsvn_delta/text_delta.c
  (apply_window): Close both the `source` and `target` streams.
  (svn_txdelta_apply2): New, revved from …
  (svn_txdelta_apply): …this function, which now calls its new version
   while disowning the source stream.

* subversion/libsvn_delta/compat.c
  (ev2_apply_textdelta): Use svn_txdelta_apply2() and keep the current
   historical behavior by disowning the stream. Also, do that …

* subversion/libsvn_client/blame.c
  (file_rev_handler): …here, …

* subversion/libsvn_client/repos_diff.c
  (apply_textdelta): …here, …

* subversion/libsvn_client/wc_editor.c
  (file_textdelta): …here, …

* subversion/libsvn_fs_base/tree.c
  (txn_body_apply_textdelta): …here, …

* subversion/libsvn_fs_fs/tree.c
  (apply_textdelta): …here, …

* subversion/libsvn_fs_x/tree.c
  (apply_textdelta): …here, …

* subversion/libsvn_wc/diff_editor.c
  (apply_textdelta): …here, …

* subversion/libsvn_wc/externals.c
  (apply_textdelta): …here, …

* subversion/libsvn_wc/update_editor.c
  (apply_textdelta): …and here.

* subversion/libsvn_client/export.c
  (apply_textdelta): Use svn_txdelta_apply2().  Do not disown the source
   stream, because it's an svn_stream_empty() stream with a no-op close
   handler.

* subversion/tests/libsvn_client/mtcc-test.c
  (handle_rev): Use svn_txdelta_apply2().  Do not disown the source stream,
   because it is a temporary svn_stream_from_stringbuf() stream created
   for this call, so we can close it together with the target.

* subversion/tests/libsvn_delta/random-test.c
  (do_random_test,
   do_random_combine_test,
   do_random_txdelta_to_svndiff_stream_test):
   Use svn_txdelta_apply2(). Do not disown the source stream, because it is
   a temporary svn_stream_from_aprfile2() stream created for this call,
   so we can close it together with the target.

* subversion/tests/libsvn_fs/fs-test.c
  (test_delta_file_stream):  Use svn_txdelta_apply2(). Do not disown the
   source stream, because it is a temporary svn_stream_from_aprfile2()
   stream created for this call, so we can close it together with
   the target.

Modified:
    subversion/trunk/subversion/include/svn_delta.h
    subversion/trunk/subversion/libsvn_client/blame.c
    subversion/trunk/subversion/libsvn_client/export.c
    subversion/trunk/subversion/libsvn_client/repos_diff.c
    subversion/trunk/subversion/libsvn_client/wc_editor.c
    subversion/trunk/subversion/libsvn_delta/compat.c
    subversion/trunk/subversion/libsvn_delta/text_delta.c
    subversion/trunk/subversion/libsvn_fs_base/tree.c
    subversion/trunk/subversion/libsvn_fs_fs/tree.c
    subversion/trunk/subversion/libsvn_fs_x/tree.c
    subversion/trunk/subversion/libsvn_wc/diff_editor.c
    subversion/trunk/subversion/libsvn_wc/externals.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c
    subversion/trunk/subversion/tests/libsvn_delta/random-test.c
    subversion/trunk/subversion/tests/libsvn_fs/fs-test.c

Modified: subversion/trunk/subversion/include/svn_delta.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_delta.h?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_delta.h (original)
+++ subversion/trunk/subversion/include/svn_delta.h Mon Nov 21 14:54:38 2022
@@ -490,18 +490,37 @@ svn_txdelta_send_contents(const unsigned
  * MD5 digest of the resulting fulltext.
  *
  * If @a error_info is non-NULL, it is inserted parenthetically into
- * the error string for any error returned by svn_txdelta_apply() or
+ * the error string for any error returned by svn_txdelta_apply2() or
  * @a *handler.  (It is normally used to provide path information,
  * since there's nothing else in the delta application's context to
  * supply a path for error messages.)
  *
- * The @a source stream will NOT be closed. The @a target stream will be
- * closed when the window handler is given a null window to signal the
- * end of the delta.
+ * @note both @a source and @a target will be closed when the window
+ * handler is given a null window to signal the end of the delta.
+ * If the closure is not desired, then you can use svn_stream_disown()
+ * to protect either or both of the streams from being closed.
  *
  * @note To avoid lifetime issues, @a error_info is copied into
  * @a pool or a subpool thereof.
+ *
+ * @since New in 1.15.
+ */
+void
+svn_txdelta_apply2(svn_stream_t *source,
+                   svn_stream_t *target,
+                   unsigned char *result_digest,
+                   const char *error_info,
+                   apr_pool_t *pool,
+                   svn_txdelta_window_handler_t *handler,
+                   void **handler_baton);
+
+/** Similar to svn_txdelta_apply2(), but the @a source stream is NOT closed.
+ * The @a target stream will be closed when the window handler is given
+ * a null window to signal the end of the delta.
+ *
+ * @deprecated Provided for backward compatibility with the 1.14 API.
  */
+SVN_DEPRECATED
 void
 svn_txdelta_apply(svn_stream_t *source,
                   svn_stream_t *target,

Modified: subversion/trunk/subversion/libsvn_client/blame.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/blame.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/blame.c (original)
+++ subversion/trunk/subversion/libsvn_client/blame.c Mon Nov 21 14:54:38 2022
@@ -572,10 +572,12 @@ file_rev_handler(void *baton, const char
     {
       /* Proper delta - get window handler for applying delta.
          svn_ra_get_file_revs2 will drive the delta editor. */
-      svn_txdelta_apply(last_stream, cur_stream, NULL, NULL,
-                        frb->currpool,
-                        &delta_baton->wrapped_handler,
-                        &delta_baton->wrapped_baton);
+      /* Keep historical behavior by disowning the stream; adjust if needed. */
+      svn_txdelta_apply2(svn_stream_disown(last_stream, frb->currpool),
+                         cur_stream, NULL, NULL,
+                         frb->currpool,
+                         &delta_baton->wrapped_handler,
+                         &delta_baton->wrapped_baton);
       *content_delta_handler = window_handler;
       *content_delta_baton = delta_baton;
     }

Modified: subversion/trunk/subversion/libsvn_client/export.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/export.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/export.c (original)
+++ subversion/trunk/subversion/libsvn_client/export.c Mon Nov 21 14:54:38 2022
@@ -741,10 +741,10 @@ apply_textdelta(void *file_baton,
 
   SVN_ERR(open_working_file_writer(&fb->file_writer, fb, fb->pool, pool));
 
-  svn_txdelta_apply(svn_stream_empty(pool),
-                    svn_wc__working_file_writer_get_stream(fb->file_writer),
-                    fb->text_digest, NULL, pool,
-                    &hb->apply_handler, &hb->apply_baton);
+  svn_txdelta_apply2(svn_stream_empty(pool),
+                     svn_wc__working_file_writer_get_stream(fb->file_writer),
+                     fb->text_digest, NULL, pool,
+                     &hb->apply_handler, &hb->apply_baton);
 
   *handler_baton = hb;
   *handler = window_handler;

Modified: subversion/trunk/subversion/libsvn_client/repos_diff.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/repos_diff.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/repos_diff.c Mon Nov 21 14:54:38 
2022
@@ -941,11 +941,12 @@ apply_textdelta(void *file_baton,
   result_stream = svn_stream_lazyopen_create(lazy_open_result, fb, TRUE,
                                              scratch_pool);
 
-  svn_txdelta_apply(src_stream,
-                    result_stream,
-                    fb->result_digest,
-                    fb->path, fb->pool,
-                    &(fb->apply_handler), &(fb->apply_baton));
+  /* Keep historical behavior by disowning the stream; adjust if needed. */
+  svn_txdelta_apply2(svn_stream_disown(src_stream, fb->pool),
+                     result_stream,
+                     fb->result_digest,
+                     fb->path, fb->pool,
+                     &(fb->apply_handler), &(fb->apply_baton));
 
   *handler = window_handler;
   *handler_baton = file_baton;

Modified: subversion/trunk/subversion/libsvn_client/wc_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/wc_editor.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/wc_editor.c (original)
+++ subversion/trunk/subversion/libsvn_client/wc_editor.c Mon Nov 21 14:54:38 
2022
@@ -495,13 +495,14 @@ file_textdelta(void *file_baton,
                                  target_dir, svn_io_file_del_none,
                                  fb->pool, fb->pool));
 
-  svn_txdelta_apply(fb->wc_file_read_stream,
-                    fb->tmp_file_write_stream,
-                    fb->digest,
-                    fb->local_abspath,
-                    fb->pool,
-                    /* Provide the handler directly */
-                    handler, handler_baton);
+  /* Keep historical behavior by disowning the stream; adjust if needed. */
+  svn_txdelta_apply2(svn_stream_disown(fb->wc_file_read_stream, fb->pool),
+                     fb->tmp_file_write_stream,
+                     fb->digest,
+                     fb->local_abspath,
+                     fb->pool,
+                     /* Provide the handler directly */
+                     handler, handler_baton);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_delta/compat.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/compat.c (original)
+++ subversion/trunk/subversion/libsvn_delta/compat.c Mon Nov 21 14:54:38 2022
@@ -854,10 +854,12 @@ ev2_apply_textdelta(void *file_baton,
   target = svn_stream_lazyopen_create(open_delta_target, change,
                                       FALSE, fb->eb->edit_pool);
 
-  svn_txdelta_apply(hb->source, target,
-                    NULL, NULL,
-                    handler_pool,
-                    &hb->apply_handler, &hb->apply_baton);
+  /* Keep historical behavior by disowning the stream; adjust if needed. */
+  svn_txdelta_apply2(svn_stream_disown(hb->source, handler_pool),
+                     target,
+                     NULL, NULL,
+                     handler_pool,
+                     &hb->apply_handler, &hb->apply_baton);
 
   hb->pool = handler_pool;
 

Modified: subversion/trunk/subversion/libsvn_delta/text_delta.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/text_delta.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/text_delta.c (original)
+++ subversion/trunk/subversion/libsvn_delta/text_delta.c Mon Nov 21 14:54:38 
2022
@@ -736,6 +736,7 @@ apply_window(svn_txdelta_window_t *windo
                    svn_checksum_size(md5_checksum));
         }
 
+      err = svn_error_compose_create(err, svn_stream_close(ab->source));
       err = svn_error_compose_create(err, svn_stream_close(ab->target));
       svn_pool_destroy(ab->pool);
 
@@ -804,13 +805,13 @@ apply_window(svn_txdelta_window_t *windo
 
 
 void
-svn_txdelta_apply(svn_stream_t *source,
-                  svn_stream_t *target,
-                  unsigned char *result_digest,
-                  const char *error_info,
-                  apr_pool_t *pool,
-                  svn_txdelta_window_handler_t *handler,
-                  void **handler_baton)
+svn_txdelta_apply2(svn_stream_t *source,
+                   svn_stream_t *target,
+                   unsigned char *result_digest,
+                   const char *error_info,
+                   apr_pool_t *pool,
+                   svn_txdelta_window_handler_t *handler,
+                   void **handler_baton)
 {
   apr_pool_t *subpool = svn_pool_create(pool);
   struct apply_baton *ab;
@@ -839,6 +840,24 @@ svn_txdelta_apply(svn_stream_t *source,
   *handler_baton = ab;
 }
 
+void
+svn_txdelta_apply(svn_stream_t *source,
+                  svn_stream_t *target,
+                  unsigned char *result_digest,
+                  const char *error_info,
+                  apr_pool_t *pool,
+                  svn_txdelta_window_handler_t *handler,
+                  void **handler_baton)
+{
+  svn_txdelta_apply2(svn_stream_disown(source, pool),
+                     target,
+                     result_digest,
+                     error_info,
+                     pool,
+                     handler,
+                     handler_baton);
+}
+
 
 
 /* Convenience routines */

Modified: subversion/trunk/subversion/libsvn_fs_base/tree.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/tree.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/tree.c Mon Nov 21 14:54:38 2022
@@ -3845,13 +3845,14 @@ txn_body_apply_textdelta(void *baton, tr
   svn_stream_set_write(tb->string_stream, write_to_string);
 
   /* Now, create a custom window handler that uses our two streams. */
-  svn_txdelta_apply(tb->source_stream,
-                    tb->string_stream,
-                    NULL,
-                    tb->path,
-                    tb->pool,
-                    &(tb->interpreter),
-                    &(tb->interpreter_baton));
+  /* Keep historical behavior by disowning the stream; adjust if needed. */
+  svn_txdelta_apply2(svn_stream_disown(tb->source_stream, tb->pool),
+                     tb->string_stream,
+                     NULL,
+                     tb->path,
+                     tb->pool,
+                     &(tb->interpreter),
+                     &(tb->interpreter_baton));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Mon Nov 21 14:54:38 2022
@@ -3066,13 +3066,14 @@ apply_textdelta(void *baton, apr_pool_t
                                          tb->pool));
 
   /* Now, create a custom window handler that uses our two streams. */
-  svn_txdelta_apply(tb->source_stream,
-                    tb->target_stream,
-                    NULL,
-                    tb->path,
-                    tb->pool,
-                    &(tb->interpreter),
-                    &(tb->interpreter_baton));
+  /* Keep historical behavior by disowning the stream; adjust if needed. */
+  svn_txdelta_apply2(svn_stream_disown(tb->source_stream, tb->pool),
+                     tb->target_stream,
+                     NULL,
+                     tb->path,
+                     tb->pool,
+                     &(tb->interpreter),
+                     &(tb->interpreter_baton));
 
   /* Make a record of this modification in the changes table. */
   return add_change(tb->root->fs, txn_id, tb->path,

Modified: subversion/trunk/subversion/libsvn_fs_x/tree.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/tree.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/tree.c Mon Nov 21 14:54:38 2022
@@ -1976,13 +1976,14 @@ apply_textdelta(void *baton,
                                         tb->pool));
 
   /* Now, create a custom window handler that uses our two streams. */
-  svn_txdelta_apply(tb->source_stream,
-                    tb->target_stream,
-                    NULL,
-                    tb->path,
-                    tb->pool,
-                    &(tb->interpreter),
-                    &(tb->interpreter_baton));
+  /* Keep historical behavior by disowning the stream; adjust if needed. */
+  svn_txdelta_apply2(svn_stream_disown(tb->source_stream, tb->pool),
+                     tb->target_stream,
+                     NULL,
+                     tb->path,
+                     tb->pool,
+                     &(tb->interpreter),
+                     &(tb->interpreter_baton));
 
   /* Make a record of this modification in the changes table. */
   return add_change(tb->root->fs, txn_id, tb->path,

Modified: subversion/trunk/subversion/libsvn_wc/diff_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff_editor.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff_editor.c Mon Nov 21 14:54:38 2022
@@ -2131,11 +2131,13 @@ apply_textdelta(void *file_baton,
                                  svn_io_file_del_on_pool_cleanup,
                                  fb->pool, fb->pool));
 
-  svn_txdelta_apply(source, temp_stream,
-                    fb->result_digest,
-                    fb->local_abspath /* error_info */,
-                    fb->pool,
-                    handler, handler_baton);
+  /* Keep historical behavior by disowning the stream; adjust if needed. */
+  svn_txdelta_apply2(svn_stream_disown(source, fb->pool),
+                     temp_stream,
+                     fb->result_digest,
+                     fb->local_abspath /* error_info */,
+                     fb->pool,
+                     handler, handler_baton);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_wc/externals.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/externals.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Mon Nov 21 14:54:38 2022
@@ -645,8 +645,10 @@ apply_textdelta(void *file_baton,
                                               eb->db, eb->wri_abspath,
                                               eb->pool, pool));
 
-  svn_txdelta_apply(src_stream, dest_stream, NULL, eb->local_abspath, pool,
-                    handler, handler_baton);
+  /* Keep historical behavior by disowning the stream; adjust if needed. */
+  svn_txdelta_apply2(svn_stream_disown(src_stream, pool),
+                     dest_stream, NULL, eb->local_abspath, pool,
+                     handler, handler_baton);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Mon Nov 21 14:54:38 
2022
@@ -3906,11 +3906,12 @@ apply_textdelta(void *file_baton,
   target = svn_stream_lazyopen_create(lazy_open_target, hb, TRUE, 
handler_pool);
 
   /* Prepare to apply the delta.  */
-  svn_txdelta_apply(source, target,
-                    hb->new_text_base_md5_digest,
-                    fb->local_abspath /* error_info */,
-                    handler_pool,
-                    &hb->apply_handler, &hb->apply_baton);
+  /* Keep historical behavior by disowning the stream; adjust if needed. */
+  svn_txdelta_apply2(svn_stream_disown(source, handler_pool), target,
+                     hb->new_text_base_md5_digest,
+                     fb->local_abspath /* error_info */,
+                     handler_pool,
+                     &hb->apply_handler, &hb->apply_baton);
 
   hb->pool = handler_pool;
   hb->fb = fb;

Modified: subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c Mon Nov 21 
14:54:38 2022
@@ -563,11 +563,11 @@ handle_rev(void *baton,
 
       svn_stringbuf_setempty(hrb->cur);
 
-      svn_txdelta_apply(svn_stream_from_stringbuf(hrb->prev, pool),
-                        svn_stream_from_stringbuf(hrb->cur, pool),
-                        NULL, NULL, pool,
-                        &hrb->inner_handler,
-                        &hrb->inner_baton);
+      svn_txdelta_apply2(svn_stream_from_stringbuf(hrb->prev, pool),
+                         svn_stream_from_stringbuf(hrb->cur, pool),
+                         NULL, NULL, pool,
+                         &hrb->inner_handler,
+                         &hrb->inner_baton);
     }
 
   hrb->last = rev;

Modified: subversion/trunk/subversion/tests/libsvn_delta/random-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_delta/random-test.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_delta/random-test.c Mon Nov 21 
14:54:38 2022
@@ -320,9 +320,9 @@ do_random_test(apr_pool_t *pool,
       apr_pool_t *delta_pool = svn_pool_create(pool);
 
       /* Make stage 4: apply the text delta.  */
-      svn_txdelta_apply(svn_stream_from_aprfile(source_copy, delta_pool),
-                        svn_stream_from_aprfile(target_regen, delta_pool),
-                        NULL, NULL, delta_pool, &handler, &handler_baton);
+      svn_txdelta_apply2(svn_stream_from_aprfile(source_copy, delta_pool),
+                         svn_stream_from_aprfile(target_regen, delta_pool),
+                         NULL, NULL, delta_pool, &handler, &handler_baton);
 
       /* Make stage 3: reparse the text delta.  */
       stream = svn_txdelta_parse_svndiff(handler, handler_baton, TRUE,
@@ -416,9 +416,9 @@ do_random_combine_test(apr_pool_t *pool,
       apr_pool_t *delta_pool = svn_pool_create(pool);
 
       /* Make stage 4: apply the text delta.  */
-      svn_txdelta_apply(svn_stream_from_aprfile(source_copy, delta_pool),
-                        svn_stream_from_aprfile(target_regen, delta_pool),
-                        NULL, NULL, delta_pool, &handler, &handler_baton);
+      svn_txdelta_apply2(svn_stream_from_aprfile(source_copy, delta_pool),
+                         svn_stream_from_aprfile(target_regen, delta_pool),
+                         NULL, NULL, delta_pool, &handler, &handler_baton);
 
       /* Make stage 3: reparse the text delta.  */
       stream = svn_txdelta_parse_svndiff(handler, handler_baton, TRUE,
@@ -574,9 +574,9 @@ do_random_txdelta_to_svndiff_stream_test
 
       /* Apply it to a copy of the source file to see if we get the
          same target back. */
-      svn_txdelta_apply(svn_stream_from_aprfile2(source_copy, TRUE, iterpool),
-                        svn_stream_from_aprfile2(new_target, TRUE, iterpool),
-                        NULL, NULL, iterpool, &handler, &handler_baton);
+      svn_txdelta_apply2(svn_stream_from_aprfile2(source_copy, TRUE, iterpool),
+                         svn_stream_from_aprfile2(new_target, TRUE, iterpool),
+                         NULL, NULL, iterpool, &handler, &handler_baton);
       push_stream = svn_txdelta_parse_svndiff(handler, handler_baton, TRUE,
                                               iterpool);
       SVN_ERR(svn_stream_copy3(delta_stream, push_stream, NULL, NULL,

Modified: subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/fs-test.c?rev=1905435&r1=1905434&r2=1905435&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Mon Nov 21 14:54:38 
2022
@@ -6596,9 +6596,9 @@ test_delta_file_stream(const svn_test_op
   svn_stringbuf_setempty(source);
   svn_stringbuf_setempty(dest);
 
-  svn_txdelta_apply(svn_stream_from_stringbuf(source, subpool),
-                    svn_stream_from_stringbuf(dest, subpool),
-                    NULL, NULL, subpool, &delta_handler, &delta_baton);
+  svn_txdelta_apply2(svn_stream_from_stringbuf(source, subpool),
+                     svn_stream_from_stringbuf(dest, subpool),
+                     NULL, NULL, subpool, &delta_handler, &delta_baton);
   SVN_ERR(svn_txdelta_send_txstream(delta_stream,
                                     delta_handler,
                                     delta_baton,
@@ -6613,9 +6613,9 @@ test_delta_file_stream(const svn_test_op
   svn_stringbuf_set(source, old_content);
   svn_stringbuf_setempty(dest);
 
-  svn_txdelta_apply(svn_stream_from_stringbuf(source, subpool),
-                    svn_stream_from_stringbuf(dest, subpool),
-                    NULL, NULL, subpool, &delta_handler, &delta_baton);
+  svn_txdelta_apply2(svn_stream_from_stringbuf(source, subpool),
+                     svn_stream_from_stringbuf(dest, subpool),
+                     NULL, NULL, subpool, &delta_handler, &delta_baton);
   SVN_ERR(svn_txdelta_send_txstream(delta_stream,
                                     delta_handler,
                                     delta_baton,
@@ -6630,9 +6630,9 @@ test_delta_file_stream(const svn_test_op
   svn_stringbuf_set(source, new_content);
   svn_stringbuf_setempty(dest);
 
-  svn_txdelta_apply(svn_stream_from_stringbuf(source, subpool),
-                    svn_stream_from_stringbuf(dest, subpool),
-                    NULL, NULL, subpool, &delta_handler, &delta_baton);
+  svn_txdelta_apply2(svn_stream_from_stringbuf(source, subpool),
+                     svn_stream_from_stringbuf(dest, subpool),
+                     NULL, NULL, subpool, &delta_handler, &delta_baton);
   SVN_ERR(svn_txdelta_send_txstream(delta_stream,
                                     delta_handler,
                                     delta_baton,


Reply via email to