You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/04/14 13:58:48 UTC

svn commit: r933918 - /subversion/trunk/subversion/libsvn_wc/adm_crawler.c

Author: julianfoad
Date: Wed Apr 14 11:58:48 2010
New Revision: 933918

URL: http://svn.apache.org/viewvc?rev=933918&view=rev
Log:
* subversion/libsvn_wc/adm_crawler.c
  (svn_wc__internal_transmit_text_deltas): Rearrange code for clarity.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_crawler.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=933918&r1=933917&r2=933918&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Wed Apr 14 11:58:48 2010
@@ -1054,8 +1054,7 @@ svn_wc__internal_transmit_text_deltas(co
 {
   svn_txdelta_window_handler_t handler;
   void *wh_baton;
-  const char *base_digest_hex;
-  const svn_checksum_t *expected_checksum = NULL;
+  const svn_checksum_t *expected_checksum;
   svn_checksum_t *verify_checksum = NULL;  /* calc'd MD5 of BASE_STREAM */
   svn_checksum_t *local_checksum;  /* calc'd MD5 of LOCAL_STREAM */
   svn_error_t *err;
@@ -1099,7 +1098,6 @@ svn_wc__internal_transmit_text_deltas(co
 
   /* Set BASE_STREAM to a stream providing the base (source) content for the
    * delta, which may be an empty stream;
-   * set BASE_DIGEST_HEX to its expected MD5 hex digest (or NULL);
    * set EXPECTED_CHECKSUM to its stored (or possibly calculated) MD5 checksum;
    * and (usually) arrange for its VERIFY_CHECKSUM to be calculated later. */
   if (! fulltext)
@@ -1165,25 +1163,30 @@ svn_wc__internal_transmit_text_deltas(co
 
           expected_checksum = p_checksum;
         }
-
-      /* apply_textdelta() is working against a base with this checksum */
-      /* ### Why '..._display()'?  expected_checksum should never be all-
-       * zero, but if it is, we would want to pass NULL not an all-zero
-       * digest to apply_textdelta(), wouldn't we? */
-      base_digest_hex = svn_checksum_to_cstring_display(expected_checksum,
-                                                        scratch_pool);
     }
   else
     {
       /* Send a fulltext. */
       base_stream = svn_stream_empty(scratch_pool);
-      base_digest_hex = NULL;
+      expected_checksum = NULL;
     }
 
   /* Tell the editor that we're about to apply a textdelta to the
      file baton; the editor returns to us a window consumer and baton.  */
-  SVN_ERR(editor->apply_textdelta(file_baton, base_digest_hex, scratch_pool,
-                                  &handler, &wh_baton));
+  {
+    /* apply_textdelta() is working against a base with this checksum */
+    const char *base_digest_hex = NULL;
+
+    if (expected_checksum)
+      /* ### Why '..._display()'?  expected_checksum should never be all-
+       * zero, but if it is, we would want to pass NULL not an all-zero
+       * digest to apply_textdelta(), wouldn't we? */
+      base_digest_hex = svn_checksum_to_cstring_display(expected_checksum,
+                                                        scratch_pool);
+
+    SVN_ERR(editor->apply_textdelta(file_baton, base_digest_hex, scratch_pool,
+                                    &handler, &wh_baton));
+  }
 
   /* Run diff processing, throwing windows at the handler. */
   err = svn_txdelta_run(base_stream, local_stream,