You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/05/02 20:12:49 UTC
svn commit: r1333138 - in
/subversion/branches/ev2-export/subversion/libsvn_client: client.h commit.c
commit_util.c
Author: hwright
Date: Wed May 2 18:12:48 2012
New Revision: 1333138
URL: http://svn.apache.org/viewvc?rev=1333138&view=rev
Log:
On the ev2-export branch:
If desired, also produce an MD5 checksum when destranslating a file for
commit.
* subversion/libsvn_client/commit_util.c
(svn_client__get_detranslated_stream): Add md5 param, and make both the
SHA1 and MD5 params optional.
* subversion/libsvn_client/commit.c
(import_file): Update caller.
* subversion/libsvn_client/client.h
(svn_client__get_detranslated_stream): Add param.
Modified:
subversion/branches/ev2-export/subversion/libsvn_client/client.h
subversion/branches/ev2-export/subversion/libsvn_client/commit.c
subversion/branches/ev2-export/subversion/libsvn_client/commit_util.c
Modified: subversion/branches/ev2-export/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/client.h?rev=1333138&r1=1333137&r2=1333138&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/client.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/client.h Wed May 2 18:12:48 2012
@@ -1116,7 +1116,8 @@ svn_client__get_normalized_stream(svn_st
Both CHECKSUM AND FSTREAM are allocated in RESULT_POOL. */
svn_error_t *
svn_client__get_detranslated_stream(svn_stream_t **fstream,
- svn_checksum_t **checksum,
+ svn_checksum_t **sha1_checksum,
+ svn_checksum_t **md5_checksum,
const char *local_abspath,
apr_hash_t *properties,
apr_pool_t *result_pool,
Modified: subversion/branches/ev2-export/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/commit.c?rev=1333138&r1=1333137&r2=1333138&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/commit.c Wed May 2 18:12:48 2012
@@ -141,7 +141,7 @@ import_file(svn_editor_t *editor,
svn_string_create(SVN_PROP_BOOLEAN_TRUE, pool));
/* Now, transmit the file contents. */
- SVN_ERR(svn_client__get_detranslated_stream(&contents, &checksum,
+ SVN_ERR(svn_client__get_detranslated_stream(&contents, &checksum, NULL,
local_abspath,
properties, pool, pool));
Modified: subversion/branches/ev2-export/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/commit_util.c?rev=1333138&r1=1333137&r2=1333138&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/commit_util.c Wed May 2 18:12:48 2012
@@ -1977,7 +1977,8 @@ svn_client__ensure_revprop_table(apr_has
svn_error_t *
svn_client__get_detranslated_stream(svn_stream_t **fstream,
- svn_checksum_t **checksum,
+ svn_checksum_t **sha1_checksum,
+ svn_checksum_t **md5_checksum,
const char *local_abspath,
apr_hash_t *properties,
apr_pool_t *result_pool,
@@ -2056,9 +2057,14 @@ svn_client__get_detranslated_stream(svn_
}
}
+ if (sha1_checksum)
+ contents = svn_stream_checksummed2(contents, sha1_checksum, NULL,
+ svn_checksum_sha1, TRUE, scratch_pool);
+ if (md5_checksum)
+ contents = svn_stream_checksummed2(contents, md5_checksum, NULL,
+ svn_checksum_md5, TRUE, scratch_pool);
+
*fstream = svn_stream_buffered(result_pool);
- contents = svn_stream_checksummed2(contents, checksum, NULL,
- svn_checksum_sha1, TRUE, scratch_pool);
SVN_ERR(svn_stream_copy3(contents, svn_stream_disown(*fstream, result_pool),
NULL, NULL, scratch_pool));