You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2010/07/25 16:57:43 UTC

svn commit: r979045 - in /subversion/trunk/subversion: libsvn_ra_neon/fetch.c mod_dav_svn/reports/update.c

Author: rhuijben
Date: Sun Jul 25 14:57:43 2010
New Revision: 979045

URL: http://svn.apache.org/viewvc?rev=979045&view=rev
Log:
Make libsvn_ra_neon pass a base_checksum when using a send all update
report. This removes a ra specific limitation that only applied to ra_neon.
(libsvn_ra_serf uses a different report style for handling updates). The
result of this patch is better working copy corruption detection.

* subversion/libsvn_ra_neon/fetch.c
  (start_element): Fetch base-checksum attribute from txdelta element.

* subversion/mod_dav_svn/reports/update.c
  (window_handler_baton): Add base_checksum field.
  (window_handler): If a base-checksum is available, send this as attribute
    on the element.
  (upd_apply_textdelta): Store the copied base checksum in the window
    handler baton for use by window_handler().

Modified:
    subversion/trunk/subversion/libsvn_ra_neon/fetch.c
    subversion/trunk/subversion/mod_dav_svn/reports/update.c

Modified: subversion/trunk/subversion/libsvn_ra_neon/fetch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/fetch.c?rev=979045&r1=979044&r2=979045&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/fetch.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/fetch.c Sun Jul 25 14:57:43 2010
@@ -1713,8 +1713,10 @@ start_element(int *elem, void *userdata,
       if (! rb->receiving_all)
         break;
 
+      base_checksum = svn_xml_get_attr_value("base-checksum", atts);
+
       SVN_ERR((*rb->editor->apply_textdelta)(rb->file_baton,
-                                             NULL, /* ### base_checksum */
+                                             base_checksum,
                                              rb->file_pool,
                                              &(rb->whandler),
                                              &(rb->whandler_baton)));

Modified: subversion/trunk/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/reports/update.c?rev=979045&r1=979044&r2=979045&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/reports/update.c Sun Jul 25 14:57:43 2010
@@ -782,6 +782,8 @@ struct window_handler_baton
   svn_boolean_t seen_first_window;  /* False until first window seen. */
   update_ctx_t *uc;
 
+  const char *base_checksum; /* For transfer as part of the S:txdelta element */
+
   /* The _real_ window handler and baton. */
   svn_txdelta_window_handler_t handler;
   void *handler_baton;
@@ -797,7 +799,14 @@ window_handler(svn_txdelta_window_t *win
   if (! wb->seen_first_window)
     {
       wb->seen_first_window = TRUE;
-      SVN_ERR(dav_svn__brigade_puts(wb->uc->bb, wb->uc->output, "<S:txdelta>"));
+
+      if (!wb->base_checksum)
+        SVN_ERR(dav_svn__brigade_puts(wb->uc->bb, wb->uc->output,
+                                      "<S:txdelta>"));
+      else
+        SVN_ERR(dav_svn__brigade_printf(wb->uc->bb, wb->uc->output,
+                                        "<S:txdelta base-checksum=\"%s\">",
+                                        wb->base_checksum));
     }
 
   SVN_ERR(wb->handler(window, wb->handler_baton));
@@ -850,6 +859,7 @@ upd_apply_textdelta(void *file_baton,
   wb = apr_palloc(file->pool, sizeof(*wb));
   wb->seen_first_window = FALSE;
   wb->uc = file->uc;
+  wb->base_checksum = file->base_checksum;
   base64_stream = dav_svn__make_base64_output_stream(wb->uc->bb,
                                                      wb->uc->output,
                                                      file->pool);