You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2012/08/24 16:12:08 UTC
svn commit: r1376924 - in
/subversion/branches/inheritable-props/subversion/libsvn_wc: upgrade.c
wc-metadata.sql
Author: pburba
Date: Fri Aug 24 14:12:07 2012
New Revision: 1376924
URL: http://svn.apache.org/viewvc?rev=1376924&view=rev
Log:
On the inheritable-props branch: Move the pending format 31 upgrade stuffs
into the format 30 upgrade bump.
* subversion/libsvn_wc/upgrade.c
(STMT_UPGRADE_TO_30): Roll the pending format 31 "nice to haves" into the
format 30 bump.
(STMT_UPGRADE_TO_31): Deleted, now part of STMT_UPGRADE_TO_30.
(STMT_UPGRADE_31_SELECT_CONFLICT_SEPARATE): Rename to...
(STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE): ...this.
(STMT_UPGRADE_31_SET_CONFLICT): Rename to...
(STMT_UPGRADE_30_SET_CONFLICT): ...this.
* subversion/libsvn_wc/wc-metadata.sql
(bump_to_31): Delete and roll into bump_to_30.
(svn_wc__upgrade_sdb): Remove execution of bump_to_31.
Modified:
subversion/branches/inheritable-props/subversion/libsvn_wc/upgrade.c
subversion/branches/inheritable-props/subversion/libsvn_wc/wc-metadata.sql
Modified: subversion/branches/inheritable-props/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_wc/upgrade.c?rev=1376924&r1=1376923&r2=1376924&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_wc/upgrade.c Fri Aug 24 14:12:07 2012
@@ -1501,63 +1501,25 @@ bump_to_30(void *baton,
svn_sqlite__db_t *sdb,
apr_pool_t *scratch_pool)
{
- svn_sqlite__stmt_t *stmt, *stmt_mark_switch_roots;
- svn_boolean_t have_row;
- apr_pool_t *iterpool = svn_pool_create(scratch_pool);
- apr_array_header_t *empty_iprops = apr_array_make(
- scratch_pool, 0, sizeof(svn_prop_inherited_item_t *));
-
- /* Add the inherited_props column to NODES. */
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_30));
-
- /* Set inherited_props to an empty array for the roots of all
- switched subtrees in the WC. This allows subsequent updates
- to recognize these roots as needing an iprops cache. */
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_SELECT_WCROOT_NODES));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
-
- SVN_ERR(svn_sqlite__get_statement(&stmt_mark_switch_roots, sdb,
- STMT_UPDATE_IPROP));
- while (have_row)
- {
- const char *switched_relpath = svn_sqlite__column_text(stmt, 1, NULL);
- apr_int64_t wc_id = svn_sqlite__column_int64(stmt, 0);
-
- SVN_ERR(svn_sqlite__bindf(stmt_mark_switch_roots, "is", wc_id,
- switched_relpath));
- SVN_ERR(svn_sqlite__bind_iprops(stmt_mark_switch_roots, 3,
- empty_iprops, iterpool));
- SVN_ERR(svn_sqlite__step_done(stmt_mark_switch_roots));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- }
-
- SVN_ERR(svn_sqlite__reset(stmt));
- svn_pool_destroy(iterpool);
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-bump_to_31(void *baton,
- svn_sqlite__db_t *sdb,
- apr_pool_t *scratch_pool)
-{
struct bump_baton *bb = baton;
svn_boolean_t have_row;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
svn_sqlite__stmt_t *stmt;
svn_sqlite__stmt_t *stmt_store;
+ svn_sqlite__stmt_t *stmt_mark_switch_roots;
svn_wc__db_t *db; /* Read only temp db */
const char *wri_abspath = bb->wcroot_abspath;
+ apr_array_header_t *empty_iprops = apr_array_make(
+ scratch_pool, 0, sizeof(svn_prop_inherited_item_t *));
SVN_ERR(svn_wc__db_open(&db, NULL, FALSE, FALSE,
scratch_pool, scratch_pool));
SVN_ERR(svn_sqlite__get_statement(&stmt_store, sdb,
- STMT_UPGRADE_31_SET_CONFLICT));
+ STMT_UPGRADE_30_SET_CONFLICT));
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_UPGRADE_31_SELECT_CONFLICT_SEPARATE));
+ STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
while (have_row)
@@ -1597,9 +1559,35 @@ bump_to_31(void *baton,
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
+
+ SVN_ERR(svn_sqlite__reset(stmt));
+
+ SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_30));
+
+ /* Set inherited_props to an empty array for the roots of all
+ switched subtrees in the WC. This allows subsequent updates
+ to recognize these roots as needing an iprops cache. */
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_SELECT_WCROOT_NODES));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+ SVN_ERR(svn_sqlite__get_statement(&stmt_mark_switch_roots, sdb,
+ STMT_UPDATE_IPROP));
+ while (have_row)
+ {
+ const char *switched_relpath = svn_sqlite__column_text(stmt, 1, NULL);
+ apr_int64_t wc_id = svn_sqlite__column_int64(stmt, 0);
+
+ SVN_ERR(svn_sqlite__bindf(stmt_mark_switch_roots, "is", wc_id,
+ switched_relpath));
+ SVN_ERR(svn_sqlite__bind_iprops(stmt_mark_switch_roots, 3,
+ empty_iprops, iterpool));
+ SVN_ERR(svn_sqlite__step_done(stmt_mark_switch_roots));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ }
+
SVN_ERR(svn_sqlite__reset(stmt));
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_31));
SVN_ERR(svn_wc__db_close(db));
return SVN_NO_ERROR;
}
@@ -1882,14 +1870,6 @@ svn_wc__upgrade_sdb(int *result_format,
scratch_pool));
*result_format = 30;
/* FALLTHROUGH */
-
-#if SVN_WC__VERSION >= 31
- case 30:
- SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_31, &bb,
- scratch_pool));
- *result_format = 31;
- /* FALLTHROUGH */
-#endif
/* ### future bumps go here. */
#if 0
case XXX-1:
Modified: subversion/branches/inheritable-props/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_wc/wc-metadata.sql?rev=1376924&r1=1376923&r2=1376924&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_wc/wc-metadata.sql Fri Aug 24 14:12:07 2012
@@ -783,13 +783,6 @@ PRAGMA user_version = 29;
-- STMT_UPGRADE_TO_30
ALTER TABLE NODES ADD COLUMN inherited_props BLOB;
-PRAGMA user_version = 30;
-
-/* ------------------------------------------------------------------------- */
-
-/* Format 31 currently just contains some nice to haves that should be included
- with the next format bump */
--- STMT_UPGRADE_TO_31
CREATE UNIQUE INDEX IF NOT EXISTS I_NODES_MOVED
ON NODES (wc_id, moved_to, op_depth);
@@ -799,9 +792,9 @@ CREATE INDEX IF NOT EXISTS I_PRISTINE_MD
working copies that were never updated by 1.7.0+ style clients */
UPDATE nodes SET file_external=1 WHERE file_external IS NOT NULL;
-PRAGMA user_version = 31;
+PRAGMA user_version = 30;
--- STMT_UPGRADE_31_SELECT_CONFLICT_SEPARATE
+-- STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE
SELECT wc_id, local_relpath,
conflict_old, conflict_working, conflict_new, prop_reject, tree_conflict_data
FROM actual_node
@@ -812,7 +805,7 @@ WHERE conflict_old IS NOT NULL
OR tree_conflict_data IS NOT NULL
ORDER by wc_id, local_relpath
--- STMT_UPGRADE_31_SET_CONFLICT
+-- STMT_UPGRADE_30_SET_CONFLICT
UPDATE actual_node SET conflict_data = ?3, conflict_old = NULL,
conflict_working = NULL, conflict_new = NULL, prop_reject = NULL,
tree_conflict_data = NULL