subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r938068 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_client/commit_util.c libsvn_wc/adm_crawler.c libsvn_wc/deprecated.c libsvn_wc/wc.h
Date Mon, 26 Apr 2010 14:45:55 GMT
Author: julianfoad
Date: Mon Apr 26 14:45:55 2010
New Revision: 938068

URL: http://svn.apache.org/viewvc?rev=938068&view=rev
Log:
Add an optional SHA-1 checksum calculation to svn_wc_transmit_text_deltas3(),
where it presently performs an MD-5 checksum calculation.

* subversion/include/svn_wc.h
  (svn_wc_transmit_text_deltas3): Add an optional SHA-1 checksum output.
    Adjust doc string of svn_wc_transmit_text_deltas2() accordingly.

* subversion/libsvn_wc/adm_crawler.c
  (svn_wc__internal_transmit_text_deltas, svn_wc_transmit_text_deltas3): Same.

* subversion/libsvn_wc/wc.h
  (svn_wc__internal_transmit_text_deltas): Same.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_transmit_text_deltas2): Adjust a caller.

* subversion/libsvn_client/commit_util.c
  (svn_client__do_commit): Adjust a caller.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_client/commit_util.c
    subversion/trunk/subversion/libsvn_wc/adm_crawler.c
    subversion/trunk/subversion/libsvn_wc/deprecated.c
    subversion/trunk/subversion/libsvn_wc/wc.h

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=938068&r1=938067&r2=938068&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Mon Apr 26 14:45:55 2010
@@ -7151,6 +7151,7 @@ svn_wc_translated_stream(svn_stream_t **
  * If @a new_text_base_md5_checksum is non-NULL, set
  * @a *new_text_base_md5_checksum to the MD5 checksum of (@a local_abspath
  * translated to repository-normal form), allocated in @a result_pool.
+ * Similarly for @a new_text_base_sha1_checksum.
  *
  * If @a fulltext, send the untranslated copy of @a local_abspath through
  * @a editor as full-text; else send it as svndiff against the current text
@@ -7169,6 +7170,7 @@ svn_wc_translated_stream(svn_stream_t **
 svn_error_t *
 svn_wc_transmit_text_deltas3(const char **tempfile,
                              const svn_checksum_t **new_text_base_md5_checksum,
+                             const svn_checksum_t **new_text_base_sha1_checksum,
                              svn_wc_context_t *wc_ctx,
                              const char *local_abspath,
                              svn_boolean_t fulltext,
@@ -7178,8 +7180,8 @@ svn_wc_transmit_text_deltas3(const char 
                              apr_pool_t *scratch_pool);
 
 /** Similar to svn_wc_transmit_text_deltas3(), but with a relative path
- * and adm_access baton, and the checksum output is a digest instead of
- * an svn_checksum_t object.
+ * and adm_access baton, and the checksum output is an MD5 digest instead of
+ * two svn_checksum_t objects.
  *
  * @since New in 1.4.
  * @deprecated Provided for backwards compatibility with the 1.6 API.

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=938068&r1=938067&r2=938068&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Mon Apr 26 14:45:55 2010
@@ -1671,7 +1671,7 @@ svn_client__do_commit(const char *base_u
 
       SVN_ERR(svn_wc_transmit_text_deltas3(new_text_base_abspaths ? &tempfile
                                                                   : NULL,
-                                           &new_text_base_md5_checksum,
+                                           &new_text_base_md5_checksum, NULL,
                                            ctx->wc_ctx, item_abspath,
                                            fulltext, editor, mod->file_baton,
                                            pool, iterpool));

Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=938068&r1=938067&r2=938068&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Mon Apr 26 14:45:55 2010
@@ -1045,6 +1045,7 @@ copying_stream(svn_stream_t *source,
 svn_error_t *
 svn_wc__internal_transmit_text_deltas(const char **tempfile,
                                       const svn_checksum_t **new_text_base_md5_checksum,
+                                      const svn_checksum_t **new_text_base_sha1_checksum,
                                       svn_wc__db_t *db,
                                       const char *local_abspath,
                                       svn_boolean_t fulltext,
@@ -1057,7 +1058,8 @@ svn_wc__internal_transmit_text_deltas(co
   void *wh_baton;
   const svn_checksum_t *expected_md5_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_checksum_t *local_md5_checksum;  /* calc'd MD5 of LOCAL_STREAM */
+  svn_checksum_t *local_sha1_checksum;  /* calc'd SHA1 of LOCAL_STREAM */
   svn_error_t *err;
   svn_stream_t *base_stream;  /* delta source */
   svn_stream_t *local_stream;  /* delta target: LOCAL_ABSPATH transl. to NF */
@@ -1190,10 +1192,16 @@ svn_wc__internal_transmit_text_deltas(co
                                     &handler, &wh_baton));
   }
 
+  if (new_text_base_sha1_checksum)
+    local_stream = svn_stream_checksummed2(local_stream,
+                                           &local_sha1_checksum,
+                                           NULL, svn_checksum_sha1, TRUE,
+                                           scratch_pool);
+
   /* Run diff processing, throwing windows at the handler. */
   err = svn_txdelta_run(base_stream, local_stream,
                         handler, wh_baton,
-                        svn_checksum_md5, &local_checksum,
+                        svn_checksum_md5, &local_md5_checksum,
                         NULL, NULL,
                         scratch_pool, scratch_pool);
 
@@ -1253,12 +1261,15 @@ svn_wc__internal_transmit_text_deltas(co
                                                      scratch_pool)));
 
   if (new_text_base_md5_checksum)
-    *new_text_base_md5_checksum = svn_checksum_dup(local_checksum,
+    *new_text_base_md5_checksum = svn_checksum_dup(local_md5_checksum,
                                                    result_pool);
+  if (new_text_base_sha1_checksum)
+    *new_text_base_sha1_checksum = svn_checksum_dup(local_sha1_checksum,
+                                                    result_pool);
 
   /* Close the file baton, and get outta here. */
   return editor->close_file(file_baton,
-                            svn_checksum_to_cstring(local_checksum,
+                            svn_checksum_to_cstring(local_md5_checksum,
                                                     scratch_pool),
                             scratch_pool);
 }
@@ -1266,6 +1277,7 @@ svn_wc__internal_transmit_text_deltas(co
 svn_error_t *
 svn_wc_transmit_text_deltas3(const char **tempfile,
                              const svn_checksum_t **new_text_base_md5_checksum,
+                             const svn_checksum_t **new_text_base_sha1_checksum,
                              svn_wc_context_t *wc_ctx,
                              const char *local_abspath,
                              svn_boolean_t fulltext,
@@ -1276,6 +1288,7 @@ svn_wc_transmit_text_deltas3(const char 
 {
   return svn_wc__internal_transmit_text_deltas(tempfile,
                                                new_text_base_md5_checksum,
+                                               new_text_base_sha1_checksum,
                                                wc_ctx->db, local_abspath,
                                                fulltext, editor,
                                                file_baton, result_pool,

Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=938068&r1=938067&r2=938068&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Mon Apr 26 14:45:55 2010
@@ -421,7 +421,7 @@ svn_wc_transmit_text_deltas2(const char 
   SVN_ERR(svn_wc_transmit_text_deltas3(tempfile,
                                        digest ? &new_text_base_md5_checksum
                                               : NULL,
-                                       wc_ctx,
+                                       NULL, wc_ctx,
                                        local_abspath, fulltext, editor,
                                        file_baton, pool, pool));
 

Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=938068&r1=938067&r2=938068&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Mon Apr 26 14:45:55 2010
@@ -512,6 +512,7 @@ svn_wc__internal_versioned_file_modcheck
 svn_error_t *
 svn_wc__internal_transmit_text_deltas(const char **tempfile,
                                       const svn_checksum_t **new_text_base_md5_checksum,
+                                      const svn_checksum_t **new_text_base_sha1_checksum,
                                       svn_wc__db_t *db,
                                       const char *local_abspath,
                                       svn_boolean_t fulltext,



Mime
View raw message