You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2011/04/19 22:28:54 UTC

svn commit: r1095194 - /subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c

Author: cmpilato
Date: Tue Apr 19 20:28:54 2011
New Revision: 1095194

URL: http://svn.apache.org/viewvc?rev=1095194&view=rev
Log:
Restore the transitational MD5->SHA1 fixup logic recently removed.
Subversion has never done anything to ensure that, for this database
format version, all checksums are SHA1.  As such, it's unreasonable to
suddenly start assuming that that is, in fact, the case.

This fixup logic removal should have been accompanied by code which
gracefully allowed Subversion to detect that the assumption is
unreasonable and advise the user regarding how to proceed.
(Translation: Do NOT just start making my working copies unusable
without an first-class upgrade path.)

* subversion/libsvn_wc/wc_db_pristine.c
  (svn_wc__db_pristine_read): Re-add the transitational md5->sha1
    fixup removed in r1091381.

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

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c?rev=1095194&r1=1095193&r2=1095194&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c Tue Apr 19 20:28:54 2011
@@ -226,6 +226,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_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,