Author: julianfoad
Date: Mon May 24 11:02:55 2010
New Revision: 947600
URL: http://svn.apache.org/viewvc?rev=947600&view=rev
Log:
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_pristine_read, svn_wc__db_pristine_remove,
svn_wc__db_pristine_check): Accept MD-5 as an alternative to SHA-1,
to make transition easier.
Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=947600&r1=947599&r2=947600&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon May 24 11:02:55 2010
@@ -1797,6 +1797,12 @@ svn_wc__db_pristine_read(svn_stream_t **
SVN_ERR_ASSERT(contents != NULL);
SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
SVN_ERR_ASSERT(sha1_checksum != NULL);
+ /* ### Transitional: accept MD-5 and look up the SHA-1. Return an error
+ * if the pristine text is not in the store. */
+ if (sha1_checksum->kind != svn_checksum_sha1)
+ SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, db, wri_abspath,
+ sha1_checksum,
+ scratch_pool, scratch_pool));
SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
@@ -1989,6 +1995,12 @@ svn_wc__db_pristine_remove(svn_wc__db_t
SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
SVN_ERR_ASSERT(sha1_checksum != NULL);
+ /* ### Transitional: accept MD-5 and look up the SHA-1. Return an error
+ * if the pristine text is not in the store. */
+ if (sha1_checksum->kind != svn_checksum_sha1)
+ SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, db, wri_abspath,
+ sha1_checksum,
+ scratch_pool, scratch_pool));
SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
@@ -2056,6 +2068,12 @@ svn_wc__db_pristine_check(svn_boolean_t
SVN_ERR_ASSERT(present != NULL);
SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
SVN_ERR_ASSERT(sha1_checksum != NULL);
+ /* ### Transitional: accept MD-5 and look up the SHA-1. Return an error
+ * if the pristine text is not in the store. */
+ if (sha1_checksum->kind != svn_checksum_sha1)
+ SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, db, wri_abspath,
+ sha1_checksum,
+ scratch_pool, scratch_pool));
SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,