Author: rhuijben
Date: Tue Apr 19 21:05:28 2011
New Revision: 1095214
URL: http://svn.apache.org/viewvc?rev=1095214&view=rev
Log:
Bump our working copy format version to 28 and fixup the remaining MD5
references in the NODES table to SHA1. (This also fixes the reference counts)
On any working copy checked out in +- the last half year (and probably longer)
this only bumps the working copy format number.
* subversion/libsvn_wc/upgrade.c
(bump_to_28): New function.
(svn_wc__upgrade_sdb): Add bump to 28.
* subversion/libsvn_wc/wc-metadata.sql
(STMT_UPGRADE_TO_28): Add the bump to format 28 query.
* subversion/libsvn_wc/wc.h
(SVN_WC__VERSION): Document format 28 and switch to 28.
* subversion/libsvn_wc/wc_db_pristine.c
(svn_wc__db_pristine_read): Revert r1095194, which reverted some parts of
r1091381.
Modified:
subversion/trunk/subversion/libsvn_wc/upgrade.c
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
subversion/trunk/subversion/libsvn_wc/wc.h
subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c
Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=1095214&r1=1095213&r2=1095214&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Tue Apr 19 21:05:28 2011
@@ -1173,6 +1173,12 @@ bump_to_27(void *baton, svn_sqlite__db_t
return SVN_NO_ERROR;
}
+static svn_error_t *
+bump_to_28(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
+{
+ SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_28));
+ return SVN_NO_ERROR;
+}
struct upgrade_data_t {
svn_sqlite__db_t *sdb;
@@ -1453,6 +1459,12 @@ svn_wc__upgrade_sdb(int *result_format,
*result_format = 27;
/* FALLTHROUGH */
+ case 27:
+ SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_28, &bb,
+ scratch_pool));
+ *result_format = 28;
+ /* FALLTHROUGH */
+
/* ### future bumps go here. */
#if 0
case XXX-1:
Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1095214&r1=1095213&r2=1095214&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Tue Apr 19 21:05:28
2011
@@ -648,6 +648,19 @@ PRAGMA user_version = 26;
-- STMT_UPGRADE_TO_27
PRAGMA user_version = 27;
+/* ------------------------------------------------------------------------- */
+
+/* Format 28 involves no schema changes, it only converts MD5 pristine
+ references to SHA1. */
+
+-- STMT_UPGRADE_TO_28
+
+UPDATE NODES SET checksum=(SELECT checksum FROM pristine
+ WHERE md5_checksum=nodes.checksum)
+WHERE EXISTS(SELECT 1 FROM pristine WHERE md5_checksum=nodes.checksum);
+
+PRAGMA user_version = 28;
+
/* ------------------------------------------------------------------------- */
Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1095214&r1=1095213&r2=1095214&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Tue Apr 19 21:05:28 2011
@@ -143,12 +143,15 @@ extern "C" {
* The change from 26 to 27 stored conflict files as relpaths rather
* than basenames.
*
+ * The change from 27 to 28 converted any remaining references to MD5 checksums
+ * to SHA1 checksums
+ *
* == 1.7.x shipped with format ???
*
* Please document any further format changes here.
*/
-#define SVN_WC__VERSION 27
+#define SVN_WC__VERSION 28
/* Formats <= this have no concept of "revert text-base/props". */
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=1095214&r1=1095213&r2=1095214&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c Tue Apr 19 21:05:28
2011
@@ -226,12 +226,6 @@ 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,