[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Sketch] Don't checksum reliable transmissions

From: Stefan Fuhrmann <stefanfuhrmann_at_alice-dsl.de>
Date: Sun, 02 May 2010 17:34:46 +0200

Hi there,

this is not a release-grade patch set but it applies to
/trunk and demonstrates the basic concept.

The idea is the following: ra_local (and possibly others)
are "reliable" in that they won't corrupt transmission.
For now, this implies that we don't need to checksum
the data again. There might be more shortcuts that
can be taken in the future.

ra_local is a relevant use-case for server-side applications
like scripts, indexing applications etc. But it would be
feasible to optionally enable that for LAN use as well.

ReliableRA.patch extends svn_repos_begin_report
with a ra_is_reliable flag and ra_local plugin is the only
one to set it to TRUE. The second patch extends the
apply_textdelta member in svn_delta_editor_t with
an calculate_checksum flag. The only place where it
is actually used is in export.c and reporter.c.

With all other patches applied, this saves 15% runtime
in 'svn export file://'. However, rev'ing svn_delta_editor_t
seems only be feasible in context of 'editor v2'.

-- Stefan^2.

Index: subversion/include/svn_delta.h
===================================================================
--- subversion/include/svn_delta.h (revision 940212)
+++ subversion/include/svn_delta.h (working copy)
@@ -937,6 +956,7 @@
    */
   svn_error_t *(*apply_textdelta)(void *file_baton,
                                   const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                                   apr_pool_t *pool,
                                   svn_txdelta_window_handler_t *handler,
                                   void **handler_baton);
Index: subversion/libsvn_client/commit.c
===================================================================
--- subversion/libsvn_client/commit.c (revision 940212)
+++ subversion/libsvn_client/commit.c (working copy)
@@ -111,7 +111,7 @@
     }
 
   /* Get an editor func that wants to consume the delta stream. */
- SVN_ERR(editor->apply_textdelta(file_baton, NULL, pool,
+ SVN_ERR(editor->apply_textdelta(file_baton, NULL, TRUE, pool,
                                   &handler, &handler_baton));
 
   if (eol_style_val)
Index: subversion/libsvn_client/export.c
===================================================================
--- subversion/libsvn_client/export.c (revision 940212)
+++ subversion/libsvn_client/export.c (working copy)
@@ -742,6 +742,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
@@ -764,7 +765,7 @@
      ### tmp_stream. we *should* be much more consistent! */
   svn_txdelta_apply(svn_stream_empty(pool),
                     svn_stream_disown(fb->tmp_stream, pool),
- fb->text_digest, NULL, pool,
+ caclulate_checksum ? fb->text_digest : NULL, NULL, pool,
                     &hb->apply_handler, &hb->apply_baton);
 
   *handler_baton = hb;
Index: subversion/libsvn_client/repos_diff.c
===================================================================
--- subversion/libsvn_client/repos_diff.c (revision 940212)
+++ subversion/libsvn_client/repos_diff.c (working copy)
@@ -744,6 +744,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
Index: subversion/libsvn_client/repos_diff_summarize.c
===================================================================
--- subversion/libsvn_client/repos_diff_summarize.c (revision 940212)
+++ subversion/libsvn_client/repos_diff_summarize.c (working copy)
@@ -251,6 +251,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
Index: subversion/libsvn_delta/cancel.c
===================================================================
--- subversion/libsvn_delta/cancel.c (revision 940212)
+++ subversion/libsvn_delta/cancel.c (working copy)
@@ -205,6 +205,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
@@ -216,6 +217,7 @@
 
   return eb->wrapped_editor->apply_textdelta(fb->wrapped_file_baton,
                                              base_checksum,
+ caclulate_checksum,
                                              pool,
                                              handler,
                                              handler_baton);
Index: subversion/libsvn_delta/debug_editor.c
===================================================================
--- subversion/libsvn_delta/debug_editor.c (revision 940212)
+++ subversion/libsvn_delta/debug_editor.c (working copy)
@@ -240,6 +240,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
@@ -253,6 +254,7 @@
 
   SVN_ERR(eb->wrapped_editor->apply_textdelta(fb->wrapped_file_baton,
                                               base_checksum,
+ caclulate_checksum,
                                               pool,
                                               handler,
                                               handler_baton));
@@ -271,8 +273,11 @@
   eb->indent_level--;
 
   SVN_ERR(write_indent(eb, pool));
- SVN_ERR(svn_stream_printf(eb->out, pool, "close_file : %s\n",
- text_checksum));
+ if (text_checksum)
+ SVN_ERR(svn_stream_printf(eb->out, pool, "close_file : %s\n",
+ text_checksum));
+ else
+ SVN_ERR(svn_stream_printf(eb->out, pool, "close_file : NULL\n"));
 
   SVN_ERR(eb->wrapped_editor->close_file(fb->wrapped_file_baton,
                                          text_checksum, pool));
Index: subversion/libsvn_delta/default_editor.c
===================================================================
--- subversion/libsvn_delta/default_editor.c (revision 940212)
+++ subversion/libsvn_delta/default_editor.c (working copy)
@@ -114,6 +114,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
Index: subversion/libsvn_delta/depth_filter_editor.c
===================================================================
--- subversion/libsvn_delta/depth_filter_editor.c (revision 940212)
+++ subversion/libsvn_delta/depth_filter_editor.c (working copy)
@@ -306,6 +306,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
@@ -322,7 +323,7 @@
   else
     {
       SVN_ERR(eb->wrapped_editor->apply_textdelta(fb->wrapped_baton,
- base_checksum, pool,
+ base_checksum, caclulate_checksum, pool,
                                                   handler, handler_baton));
     }
   return SVN_NO_ERROR;
Index: subversion/libsvn_ra_neon/commit.c
===================================================================
--- subversion/libsvn_ra_neon/commit.c (revision 940212)
+++ subversion/libsvn_ra_neon/commit.c (working copy)
@@ -1191,6 +1191,7 @@
 static svn_error_t *
 commit_apply_txdelta(void *file_baton,
                      const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                      apr_pool_t *pool,
                      svn_txdelta_window_handler_t *handler,
                      void **handler_baton)
Index: subversion/libsvn_ra_neon/fetch.c
===================================================================
--- subversion/libsvn_ra_neon/fetch.c (revision 940212)
+++ subversion/libsvn_ra_neon/fetch.c (working copy)
@@ -540,6 +540,7 @@
 
   SVN_ERR_W((*editor->apply_textdelta)(file_baton,
                                        base_checksum,
+ TRUE,
                                        pool,
                                        &frc.handler,
                                        &frc.handler_baton),
@@ -1715,6 +1716,7 @@
 
       SVN_ERR((*rb->editor->apply_textdelta)(rb->file_baton,
                                              NULL, /* ### base_checksum */
+ TRUE,
                                              rb->file_pool,
                                              &(rb->whandler),
                                              &(rb->whandler_baton)));
Index: subversion/libsvn_ra_neon/replay.c
===================================================================
--- subversion/libsvn_ra_neon/replay.c (revision 940212)
+++ subversion/libsvn_ra_neon/replay.c (working copy)
@@ -282,6 +282,7 @@
 
           SVN_ERR(rb->editor->apply_textdelta(rb->file_baton,
                                               checksum,
+ TRUE,
                                               TOP_DIR(rb).file_pool,
                                               &rb->whandler,
                                               &rb->whandler_baton));
Index: subversion/libsvn_ra_serf/commit.c
===================================================================
--- subversion/libsvn_ra_serf/commit.c (revision 940212)
+++ subversion/libsvn_ra_serf/commit.c (working copy)
@@ -1744,6 +1744,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
Index: subversion/libsvn_ra_serf/replay.c
===================================================================
--- subversion/libsvn_ra_serf/replay.c (revision 940212)
+++ subversion/libsvn_ra_serf/replay.c (working copy)
@@ -387,7 +387,7 @@
           checksum = apr_pstrdup(info->pool, checksum);
         }
 
- SVN_ERR(ctx->editor->apply_textdelta(info->baton, checksum,
+ SVN_ERR(ctx->editor->apply_textdelta(info->baton, checksum, TRUE,
                                            info->pool,
                                            &textdelta,
                                            &textdelta_baton));
Index: subversion/libsvn_ra_serf/update.c
===================================================================
--- subversion/libsvn_ra_serf/update.c (revision 940212)
+++ subversion/libsvn_ra_serf/update.c (working copy)
@@ -796,6 +796,7 @@
 
       err = info->dir->update_editor->apply_textdelta(info->file_baton,
                                                       info->base_checksum,
+ TRUE,
                                                       info->editor_pool,
                                                       &info->textdelta,
                                                       &info->textdelta_baton);
@@ -1093,6 +1094,7 @@
     {
       SVN_ERR(info->dir->update_editor->apply_textdelta(info->file_baton,
                                                     info->base_checksum,
+ TRUE,
                                                     info->editor_pool,
                                                     &info->textdelta,
                                                     &info->textdelta_baton));
Index: subversion/libsvn_ra_svn/editorp.c
===================================================================
--- subversion/libsvn_ra_svn/editorp.c (revision 940212)
+++ subversion/libsvn_ra_svn/editorp.c (working copy)
@@ -295,6 +295,7 @@
 
 static svn_error_t *ra_svn_apply_textdelta(void *file_baton,
                                            const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                                            apr_pool_t *pool,
                                            svn_txdelta_window_handler_t *wh,
                                            void **wh_baton)
@@ -666,7 +667,7 @@
     return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
                             _("Apply-textdelta already active"));
   entry->pool = svn_pool_create(ds->file_pool);
- SVN_CMD_ERR(ds->editor->apply_textdelta(entry->baton, base_checksum,
+ SVN_CMD_ERR(ds->editor->apply_textdelta(entry->baton, base_checksum, FALSE,
                                           entry->pool, &wh, &wh_baton));
   entry->dstream = svn_txdelta_parse_svndiff(wh, wh_baton, TRUE, entry->pool);
   return SVN_NO_ERROR;
Index: subversion/libsvn_repos/commit.c
===================================================================
--- subversion/libsvn_repos/commit.c (revision 940212)
+++ subversion/libsvn_repos/commit.c (working copy)
@@ -404,6 +404,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
Index: subversion/libsvn_repos/delta.c
===================================================================
--- subversion/libsvn_repos/delta.c (revision 940212)
+++ subversion/libsvn_repos/delta.c (working copy)
@@ -586,7 +586,7 @@
 
   /* Get a handler that will apply the delta to the file. */
   SVN_ERR(c->editor->apply_textdelta
- (file_baton, base_checksum, pool,
+ (file_baton, base_checksum, TRUE, pool,
            &delta_handler, &delta_handler_baton));
 
   if (c->text_deltas && delta_stream)
Index: subversion/libsvn_repos/node_tree.c
===================================================================
--- subversion/libsvn_repos/node_tree.c (revision 940212)
+++ subversion/libsvn_repos/node_tree.c (working copy)
@@ -358,6 +358,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
Index: subversion/libsvn_repos/replay.c
===================================================================
--- subversion/libsvn_repos/replay.c (revision 940212)
+++ subversion/libsvn_repos/replay.c (working copy)
@@ -269,7 +269,7 @@
                                                subpool));
             }
 
- SVN_ERR(editor->apply_textdelta(file_baton, NULL, pool,
+ SVN_ERR(editor->apply_textdelta(file_baton, NULL, TRUE, pool,
                                           &delta_handler,
                                           &delta_handler_baton));
 
@@ -614,7 +614,7 @@
               hex_digest = svn_checksum_to_cstring(checksum, pool);
             }
 
- SVN_ERR(editor->apply_textdelta(file_baton, hex_digest, pool,
+ SVN_ERR(editor->apply_textdelta(file_baton, hex_digest, TRUE, pool,
                                           &delta_handler,
                                           &delta_handler_baton));
           if (cb->compare_root)
Index: subversion/libsvn_repos/reporter.c
===================================================================
--- subversion/libsvn_repos/reporter.c (revision 940212)
+++ subversion/libsvn_repos/reporter.c (working copy)
@@ -572,7 +574,8 @@
     }
 
   /* Send the delta stream if desired, or just a NULL window if not. */
- SVN_ERR(b->editor->apply_textdelta(file_baton, s_hex_digest, pool,
+ SVN_ERR(b->editor->apply_textdelta(file_baton, s_hex_digest,
+ b->ra_is_reliable ? FALSE : TRUE, pool,
                                      &dhandler, &dbaton));
   if (b->text_deltas)
     {
@@ -881,10 +884,15 @@
                                 t_path, info ? info->lock_token : NULL, pool));
         }
 
- SVN_ERR(svn_fs_file_checksum(&checksum, svn_checksum_md5, b->t_root,
- t_path, TRUE, pool));
- hex_digest = svn_checksum_to_cstring(checksum, pool);
- return b->editor->close_file(new_baton, hex_digest, pool);
+ if (!b->ra_is_reliable)
+ {
+ SVN_ERR(svn_fs_file_checksum(&checksum, svn_checksum_md5, b->t_root,
+ t_path, TRUE, pool));
+ hex_digest = svn_checksum_to_cstring(checksum, pool);
+ return b->editor->close_file(new_baton, hex_digest, pool);
+ }
+ else
+ return b->editor->close_file(new_baton, NULL, pool);
     }
 }
 
Index: subversion/libsvn_wc/adm_crawler.c
===================================================================
--- subversion/libsvn_wc/adm_crawler.c (revision 940212)
+++ subversion/libsvn_wc/adm_crawler.c (working copy)
@@ -1201,7 +1201,7 @@
       base_digest_hex = svn_checksum_to_cstring_display(expected_md5_checksum,
                                                         scratch_pool);
 
- SVN_ERR(editor->apply_textdelta(file_baton, base_digest_hex, scratch_pool,
+ SVN_ERR(editor->apply_textdelta(file_baton, base_digest_hex, TRUE, scratch_pool,
                                     &handler, &wh_baton));
   }
 
Index: subversion/libsvn_wc/ambient_depth_filter_editor.c
===================================================================
--- subversion/libsvn_wc/ambient_depth_filter_editor.c (revision 940212)
+++ subversion/libsvn_wc/ambient_depth_filter_editor.c (working copy)
@@ -518,6 +518,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
@@ -534,7 +535,7 @@
     }
 
   return eb->wrapped_editor->apply_textdelta(fb->wrapped_baton,
- base_checksum, pool,
+ base_checksum, caclulate_checksum, pool,
                                              handler, handler_baton);
 }
 
Index: subversion/libsvn_wc/diff.c
===================================================================
--- subversion/libsvn_wc/diff.c (revision 940212)
+++ subversion/libsvn_wc/diff.c (working copy)
@@ -1490,6 +1490,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
Index: subversion/libsvn_wc/status.c
===================================================================
--- subversion/libsvn_wc/status.c (revision 940212)
+++ subversion/libsvn_wc/status.c (working copy)
@@ -2027,6 +2027,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
Index: subversion/libsvn_wc/update_editor.c
===================================================================
--- subversion/libsvn_wc/update_editor.c (revision 940212)
+++ subversion/libsvn_wc/update_editor.c (working copy)
@@ -4046,6 +4046,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
Index: subversion/svnsync/sync.c
===================================================================
--- subversion/svnsync/sync.c (revision 940212)
+++ subversion/svnsync/sync.c (working copy)
@@ -307,6 +307,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
+ svn_boolean_t caclulate_checksum,
                 apr_pool_t *pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
@@ -324,7 +325,8 @@
 
   eb->got_textdeltas = TRUE;
   return eb->wrapped_editor->apply_textdelta(fb->wrapped_node_baton,
- base_checksum, pool,
+ base_checksum,
+ caclulate_checksum, pool,
                                              handler, handler_baton);
 }
 

Index: subversion/include/svn_repos.h
===================================================================
--- subversion/include/svn_repos.h (revision 940212)
+++ subversion/include/svn_repos.h (working copy)
@@ -596,7 +596,38 @@
  * than or equal to the depth of the working copy, then the editor
  * operations will affect only paths at or above @a depth.
  *
+ * Certain RA layers, ra_local in particular, are reliable. That is,
+ * we can reasonably sure that no data gets corrupted while being
+ * transmitted through that RA layer. In that case, we may skip checksum
+ * tests, for instance.
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_repos_begin_report3(void **report_baton,
+ svn_revnum_t revnum,
+ svn_repos_t *repos,
+ const char *fs_base,
+ const char *target,
+ const char *tgt_path,
+ svn_boolean_t text_deltas,
+ svn_depth_t depth,
+ svn_boolean_t ignore_ancestry,
+ svn_boolean_t send_copyfrom_args,
+ const svn_delta_editor_t *editor,
+ void *edit_baton,
+ svn_repos_authz_func_t authz_read_func,
+ void *authz_read_baton,
+ svn_boolean_t ra_is_reliable,
+ apr_pool_t *pool);
+
+/**
+ * The same as svn_repos_begin_report3(), but setting @a ra_is_reliable
+ * to FALSE.
+ *
  * @since New in 1.5.
+ *
+ * @deprecated Provided for backward compatibility with the 1.6 API.
  */
 svn_error_t *
 svn_repos_begin_report2(void **report_baton,
@@ -648,7 +679,7 @@
 
 
 /**
- * Given a @a report_baton constructed by svn_repos_begin_report2(),
+ * Given a @a report_baton constructed by svn_repos_begin_report3(),
  * record the presence of @a path, at @a revision with depth @a depth,
  * in the current tree.
  *
@@ -719,7 +750,7 @@
                    apr_pool_t *pool);
 
 /**
- * Given a @a report_baton constructed by svn_repos_begin_report2(),
+ * Given a @a report_baton constructed by svn_repos_begin_report3(),
  * record the presence of @a path in the current tree, containing the contents
  * of @a link_path at @a revision with depth @a depth.
  *
@@ -785,7 +816,7 @@
                     svn_boolean_t start_empty,
                     apr_pool_t *pool);
 
-/** Given a @a report_baton constructed by svn_repos_begin_report2(),
+/** Given a @a report_baton constructed by svn_repos_begin_report3(),
  * record the non-existence of @a path in the current tree.
  *
  * @a path may not be underneath a path on which svn_repos_set_path3()
@@ -801,7 +832,7 @@
                       const char *path,
                       apr_pool_t *pool);
 
-/** Given a @a report_baton constructed by svn_repos_begin_report2(),
+/** Given a @a report_baton constructed by svn_repos_begin_report3(),
  * finish the report and drive the editor as specified when the report
  * baton was constructed.
  *
@@ -818,7 +849,7 @@
                         apr_pool_t *pool);
 
 
-/** Given a @a report_baton constructed by svn_repos_begin_report2(),
+/** Given a @a report_baton constructed by svn_repos_begin_report3(),
  * abort the report. This function can be called anytime before
  * svn_repos_finish_report() is called.
  *
@@ -892,7 +923,7 @@
  * the total size of the delta.
  *
  * ### svn_repos_dir_delta2 is mostly superceded by the reporter
- * ### functionality (svn_repos_begin_report2 and friends).
+ * ### functionality (svn_repos_begin_report3 and friends).
  * ### svn_repos_dir_delta2 does allow the roots to be transaction
  * ### roots rather than just revision roots, and it has the
  * ### entry_props flag. Almost all of Subversion's own code uses the
Index: subversion/libsvn_ra_local/ra_plugin.c
===================================================================
--- subversion/libsvn_ra_local/ra_plugin.c (revision 940212)
+++ subversion/libsvn_ra_local/ra_plugin.c (working copy)
@@ -293,7 +293,7 @@
                                               pool));
 
   /* Build a reporter baton. */
- SVN_ERR(svn_repos_begin_report2(&rbaton,
+ SVN_ERR(svn_repos_begin_report3(&rbaton,
                                   revision,
                                   sess->repos,
                                   sess->fs_path->data,
@@ -307,6 +307,7 @@
                                   edit_baton,
                                   NULL,
                                   NULL,
+ TRUE,
                                   pool));
 
   /* Wrap the report baton given us by the repos layer with our own
Index: subversion/libsvn_repos/deprecated.c
===================================================================
--- subversion/libsvn_repos/deprecated.c (revision 940212)
+++ subversion/libsvn_repos/deprecated.c (working copy)
@@ -159,6 +159,41 @@
 
 /*** From reporter.c ***/
 svn_error_t *
+svn_repos_begin_report2(void **report_baton,
+ svn_revnum_t revnum,
+ svn_repos_t *repos,
+ const char *fs_base,
+ const char *target,
+ const char *tgt_path,
+ svn_boolean_t text_deltas,
+ svn_depth_t depth,
+ svn_boolean_t ignore_ancestry,
+ svn_boolean_t send_copyfrom_args,
+ const svn_delta_editor_t *editor,
+ void *edit_baton,
+ svn_repos_authz_func_t authz_read_func,
+ void *authz_read_baton,
+ apr_pool_t *pool)
+{
+ return svn_repos_begin_report3(report_baton,
+ revnum,
+ repos,
+ fs_base,
+ target,
+ tgt_path,
+ text_deltas,
+ depth,
+ ignore_ancestry,
+ send_copyfrom_args,
+ editor,
+ edit_baton,
+ authz_read_func,
+ authz_read_baton,
+ FALSE,
+ pool);
+}
+
+svn_error_t *
 svn_repos_begin_report(void **report_baton,
                        svn_revnum_t revnum,
                        const char *username,
@@ -175,7 +210,7 @@
                        void *authz_read_baton,
                        apr_pool_t *pool)
 {
- return svn_repos_begin_report2(report_baton,
+ return svn_repos_begin_report3(report_baton,
                                  revnum,
                                  repos,
                                  fs_base,
@@ -189,6 +224,7 @@
                                  edit_baton,
                                  authz_read_func,
                                  authz_read_baton,
+ FALSE,
                                  pool);
 }
 
Index: subversion/libsvn_repos/reporter.c
===================================================================
--- subversion/libsvn_repos/reporter.c (revision 940212)
+++ subversion/libsvn_repos/reporter.c (working copy)
@@ -87,7 +87,7 @@
    driven by the client as it describes its working copy revisions. */
 typedef struct report_baton_t
 {
- /* Parameters remembered from svn_repos_begin_report2 */
+ /* Parameters remembered from svn_repos_begin_report3 */
   svn_repos_t *repos;
   const char *fs_base; /* FS path corresponding to wc anchor */
   const char *s_operand; /* Anchor-relative wc target (may be empty) */
@@ -95,6 +95,8 @@
   const char *t_path; /* FS path the edit will bring the wc to */
   svn_boolean_t text_deltas; /* Whether to report text deltas */
 
+ svn_boolean_t ra_is_reliable;/* If not, we must checksum incoming data */
+
   /* If the client requested a specific depth, record it here; if the
      client did not, then this is svn_depth_unknown, and the depth of
      information transmitted from server to client will be governed
@@ -899,7 +907,7 @@
 
    WC_DEPTH is this path's depth as reported by set_path/link_path.
    REQUESTED_DEPTH is derived from the depth set by
- svn_repos_begin_report().
+ svn_repos_begin_report3().
 
    When iterating over this directory's entries, the following tables
    describe what happens for all possible combinations
@@ -1368,7 +1376,7 @@
 
 
 svn_error_t *
-svn_repos_begin_report2(void **report_baton,
+svn_repos_begin_report3(void **report_baton,
                         svn_revnum_t revnum,
                         svn_repos_t *repos,
                         const char *fs_base,
@@ -1382,6 +1390,7 @@
                         void *edit_baton,
                         svn_repos_authz_func_t authz_read_func,
                         void *authz_read_baton,
+ svn_boolean_t ra_is_reliable,
                         apr_pool_t *pool)
 {
   report_baton_t *b;
@@ -1408,6 +1417,7 @@
   b->edit_baton = edit_baton;
   b->authz_read_func = authz_read_func;
   b->authz_read_baton = authz_read_baton;
+ b->ra_is_reliable = ra_is_reliable;
 
   SVN_ERR(svn_io_open_unique_file3(&b->tempfile, NULL, NULL,
                                    svn_io_file_del_on_pool_cleanup,
Index: subversion/mod_dav_svn/reports/update.c
===================================================================
--- subversion/mod_dav_svn/reports/update.c (revision 940212)
+++ subversion/mod_dav_svn/reports/update.c (working copy)
@@ -1202,7 +1202,7 @@
   editor->close_file = upd_close_file;
   editor->absent_file = upd_absent_file;
   editor->close_edit = upd_close_edit;
- if ((serr = svn_repos_begin_report2(&rbaton, revnum,
+ if ((serr = svn_repos_begin_report3(&rbaton, revnum,
                                       repos->repos,
                                       src_path, target,
                                       dst_path,
@@ -1213,6 +1213,7 @@
                                       editor, &uc,
                                       dav_svn__authz_read_func(&arb),
                                       &arb,
+ FALSE,
                                       resource->pool)))
     {
       return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
Index: subversion/svnserve/serve.c
===================================================================
--- subversion/svnserve/serve.c (revision 940212)
+++ subversion/svnserve/serve.c (working copy)
@@ -821,13 +821,13 @@
   /* Make an svn_repos report baton. Tell it to drive the network editor
    * when the report is complete. */
   svn_ra_svn_get_editor(&editor, &edit_baton, conn, pool, NULL, NULL);
- SVN_CMD_ERR(svn_repos_begin_report2(&report_baton, rev, b->repos,
+ SVN_CMD_ERR(svn_repos_begin_report3(&report_baton, rev, b->repos,
                                       b->fs_path->data, target, tgt_path,
                                       text_deltas, depth, ignore_ancestry,
                                       send_copyfrom_args,
                                       editor, edit_baton,
                                       authz_check_access_cb_func(b),
- b, pool));
+ b, FALSE, pool));
 
   rb.sb = b;
   rb.repos_url = svn_path_uri_decode(b->repos_url, pool);
Index: subversion/tests/libsvn_repos/repos-test.c
===================================================================
--- subversion/tests/libsvn_repos/repos-test.c (revision 940212)
+++ subversion/tests/libsvn_repos/repos-test.c (working copy)
@@ -1054,9 +1054,10 @@
     SVN_ERR(create_rmlocks_editor(&editor, &edit_baton, &removed, subpool));
 
     /* Report what we have. */
- SVN_ERR(svn_repos_begin_report2(&report_baton, 1, repos, "/", "", NULL,
+ SVN_ERR(svn_repos_begin_report3(&report_baton, 1, repos, "/", "", NULL,
                                     FALSE, svn_depth_infinity, FALSE, FALSE,
- editor, edit_baton, NULL, NULL, subpool));
+ editor, edit_baton, NULL, NULL, FALSE,
+ subpool));
     SVN_ERR(svn_repos_set_path3(report_baton, "", 1,
                                 svn_depth_infinity,
                                 FALSE, NULL, subpool));
@@ -2001,9 +2002,10 @@
   SVN_ERR(dir_delta_get_editor(&editor, &edit_baton, fs,
                                txn_root, "", subpool));
 
- SVN_ERR(svn_repos_begin_report2(&report_baton, 2, repos, "/", "", NULL,
+ SVN_ERR(svn_repos_begin_report3(&report_baton, 2, repos, "/", "", NULL,
                                   TRUE, svn_depth_infinity, FALSE, FALSE,
- editor, edit_baton, NULL, NULL, subpool));
+ editor, edit_baton, NULL, NULL, FALSE,
+ subpool));
   SVN_ERR(svn_repos_set_path3(report_baton, "", 1,
                               svn_depth_infinity,
                               FALSE, NULL, subpool));
@@ -2058,9 +2060,10 @@
   SVN_ERR(dir_delta_get_editor(&editor, &edit_baton, fs,
                                txn_root, "", subpool));
 
- SVN_ERR(svn_repos_begin_report2(&report_baton, 2, repos, "/", "", NULL,
+ SVN_ERR(svn_repos_begin_report3(&report_baton, 2, repos, "/", "", NULL,
                                   TRUE, svn_depth_infinity, FALSE, FALSE,
- editor, edit_baton, NULL, NULL, subpool));
+ editor, edit_baton, NULL, NULL, FALSE,
+ subpool));
   SVN_ERR(svn_repos_set_path3(report_baton, "", 1,
                               svn_depth_infinity,
                               FALSE, NULL, subpool));
Received on 2010-05-02 17:35:23 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.