Author: cmpilato
Date: Fri May 20 01:31:49 2011
New Revision: 1125199

URL: http://svn.apache.org/viewvc?rev=1125199&view=rev
Log:
Remove a superfluous FS request for the MD5 checksum of every added
file sent through mod_dav_svn's update editor.  As it turns out, the
editor wasn't doing anything with the value, and the driver of the
editor (the reporter logic) provides exactly that same checksum via
the editor's close_file() interface anyway.

* subversion/mod_dav_svn/reports/update.c
  (item_baton_t): Remove now-used 'text_checksum' member.
  (add_helper): Don't bother calculating the checksum -- we never used
    the results of this calculation anyway!
  (close_helper): Don't transmit the text checksum -- upd_close_file()
    does this itself now.
  (upd_close_file): Transmit 'text_checksum' directly.

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

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=1125199&r1=1125198&r2=1125199&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/reports/update.c Fri May 20 
01:31:49 2011
@@ -95,7 +95,6 @@ typedef struct item_baton_t {
                             without dst_path as prefix. */
 
   const char *base_checksum;   /* base_checksum (from apply_textdelta) */
-  const char *text_checksum;   /* text_checksum (from close_file) */
 
   svn_boolean_t text_changed;        /* Did the file's contents change? */
   svn_boolean_t added;               /* File added? (Implies text_changed.) */
@@ -299,13 +298,6 @@ add_helper(svn_boolean_t is_dir,
 
       if (! is_dir)
         {
-          /* files have checksums */
-          svn_checksum_t *checksum;
-          SVN_ERR(svn_fs_file_checksum(&checksum, svn_checksum_md5,
-                                       uc->rev_root, real_path, TRUE,
-                                       pool));
-
-          child->text_checksum = svn_checksum_to_cstring(checksum, pool);
         }
       else
         {
@@ -429,15 +421,6 @@ close_helper(svn_boolean_t is_dir, item_
         }
     }
 
-  if (baton->text_checksum)
-    {
-      SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
-                                      "<S:prop>"
-                                      "<V:md5-checksum>%s</V:md5-checksum>"
-                                      "</S:prop>",
-                                      baton->text_checksum));
-    }
-
   if (baton->added)
     SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
                                     "</S:add-%s>" DEBUG_CR,
@@ -795,9 +778,6 @@ upd_close_file(void *file_baton, const c
 {
   item_baton_t *file = file_baton;
 
-  file->text_checksum = text_checksum ?
-    apr_pstrdup(file->pool, text_checksum) : NULL;
-
   /* If we are not in "send all" mode, and this file is not a new
      addition or didn't otherwise have changed text, tell the client
      to fetch it. */
@@ -811,6 +791,15 @@ upd_close_file(void *file_baton, const c
                file->base_checksum ? "\"" : ""));
     }
 
+  if (text_checksum)
+    {
+      SVN_ERR(dav_svn__brigade_printf(file->uc->bb, file->uc->output,
+                                      "<S:prop>"
+                                      "<V:md5-checksum>%s</V:md5-checksum>"
+                                      "</S:prop>",
+                                      text_checksum));
+    }
+
   return close_helper(FALSE /* is_dir */, file);
 }
 


Reply via email to