You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/08/17 18:48:09 UTC

svn commit: r986391 - in /subversion/trunk/subversion/libsvn_wc: upgrade.c wc-queries.sql

Author: julianfoad
Date: Tue Aug 17 16:48:09 2010
New Revision: 986391

URL: http://svn.apache.org/viewvc?rev=986391&view=rev
Log:
Remove experimental code for bumping a 1.7-dev WC to single-DB format 19 on
the fly, as it wasn't finished and an external script 'bump-to-19.py' that
implements this upgrade was committed in r986316.

* subversion/libsvn_wc/upgrade.c
  (bump_baton): Remove the single-DB path.
  (bump_to_19): Remove.
  (svn_wc__upgrade_sdb): Remove the bump_to_19() call and leave a TODO
    comment about handling this case in some other way.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_ATTACH_WCROOT_DB,
   STMT_COPY_BASE_NODE_TABLE_TO_WCROOT_DB,
   STMT_COPY_WORKING_NODE_TABLE_TO_WCROOT_DB,
   STMT_COPY_ACTUAL_NODE_TABLE_TO_WCROOT_DB,
   STMT_COPY_LOCK_TABLE_TO_WCROOT_DB,
   STMT_COPY_PRISTINE_TABLE_TO_WCROOT_DB): Remove.

Modified:
    subversion/trunk/subversion/libsvn_wc/upgrade.c
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql

Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=986391&r1=986390&r2=986391&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Tue Aug 17 16:48:09 2010
@@ -877,9 +877,6 @@ migrate_locks(const char *wcroot_abspath
 
 struct bump_baton {
   const char *wcroot_abspath;
-#ifdef SINGLE_DB
-  const char *single_db_wcroot_abspath;
-#endif
 };
 
 /* */
@@ -1153,74 +1150,6 @@ bump_to_17(void *baton, svn_sqlite__db_t
 }
 
 
-#ifdef SINGLE_DB
-/* Migrate one directory to a Single DB (per WC): if this is a subdirectory,
- * move all of its DB rows and pristine texts to the real WC-root.
- *
- * ### JAF: This is experimental code for others to use or ignore until I
- *          get back to it.  It may need to be re-written in a completely
- *          different way.  Especially, it probably wants to be moved from
- *          the auto-upgrade code path to the manual-upgrade code path.
- *          How to make the caller provide the BATON->wcroot_abspath and
- */
-static svn_error_t *
-bump_to_19(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
-  struct bump_baton *bb = baton;
-  const char *this_wc_dir_abspath = bb->wcroot_abspath;
-  const char *single_db_wcroot_abspath = bb->single_db_wcroot_abspath;
-  const char *this_wc_dir_relpath
-    = svn_relpath_is_child(single_db_wcroot_abspath, this_wc_dir_abspath,
-                           scratch_pool);
-  const char *parent_wc_dir_relpath
-    = svn_relpath_dirname(this_wc_dir_relpath, scratch_pool);
-  const char *single_db_sdb_abspath;
-  svn_sqlite__stmt_t *stmt;
-
-  /* If this is the single-DB WC root directory, there is nothing to do for
-   * this particular directory. */
-  if (strcmp(this_wc_dir_abspath, single_db_wcroot_abspath) == 0)
-    return SVN_NO_ERROR;
-
-  /* Get the path to the WC-root SDB as a native style path, UTF-8-encoded. */
-  single_db_sdb_abspath = svn_wc__adm_child(single_db_wcroot_abspath, "wc.db",
-                                            scratch_pool);
-  /* ### TODO: convert path to native style */
-
-  /* Attach the single-db so we can write into it. */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_ATTACH_WCROOT_DB));
-  SVN_ERR(svn_sqlite__bindf(stmt, "s", single_db_sdb_abspath));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-
-  /* ### TODO: the REPOSITORY table */
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
-                                    STMT_COPY_BASE_NODE_TABLE_TO_WCROOT_DB));
-  SVN_ERR(svn_sqlite__bindf(stmt, "ss", this_wc_dir_relpath, parent_wc_dir_relpath));
-  SVN_ERR(svn_sqlite__update(NULL, stmt));
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
-                                    STMT_COPY_WORKING_NODE_TABLE_TO_WCROOT_DB));
-  SVN_ERR(svn_sqlite__bindf(stmt, "ss", this_wc_dir_relpath, parent_wc_dir_relpath));
-  SVN_ERR(svn_sqlite__update(NULL, stmt));
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
-                                    STMT_COPY_ACTUAL_NODE_TABLE_TO_WCROOT_DB));
-  SVN_ERR(svn_sqlite__bindf(stmt, "ss", this_wc_dir_relpath, parent_wc_dir_relpath));
-  SVN_ERR(svn_sqlite__update(NULL, stmt));
-
-  SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_COPY_LOCK_TABLE_TO_WCROOT_DB));
-
-  SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_COPY_PRISTINE_TABLE_TO_WCROOT_DB));
-
-  /* ### TODO: move the pristine text files from this_wc_dir_abspath to
-   * single_db_wcroot_abspath. */
-
-  return SVN_NO_ERROR;
-}
-#endif  /* SINGLE_DB */
-
-
 #if 0 /* ### no tree conflict migration yet */
 
 /* */
@@ -1488,11 +1417,11 @@ svn_wc__upgrade_sdb(int *result_format,
 
 #if (SVN_WC__VERSION > 18)
       case 18:
-        /* Merge all subdirectory DBs and pristines into the WC-root. */
-        SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_19, &bb,
-                                             scratch_pool));
+        /* ### TODO: Either upgrade to single-DB format here, or quit
+         * at format 18 and ask the user to run the external script
+         * 'tools/dev/wc-ng/bump-to-19.py'. */
+        break;
 
-        *result_format = 19;
         /* FALLTHROUGH  */
 #endif
 

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=986391&r1=986390&r2=986391&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Tue Aug 17 16:48:09 2010
@@ -692,86 +692,6 @@ SELECT 0, presence, wc_id FROM BASE_NODE
 UNION ALL
 SELECT 1, presence, wc_id FROM WORKING_NODE WHERE local_relpath = ?1;
 
--- STMT_ATTACH_WCROOT_DB
-/* ?1 is the path to the WC-root DB file to attach. */
-ATTACH ?1 AS root;
-
--- STMT_COPY_BASE_NODE_TABLE_TO_WCROOT_DB
-/* Copy BASE_NODE to WC-root DB: first the '' row, then the rest. */
-/* ?1 is the wc_relpath of the subdirectory that we're processing. */
-/* ?2 is the wc_relpath of the parent of the subdir we're processing. */
-INSERT INTO root.BASE_NODE (
-    wc_id, local_relpath, repos_id, repos_relpath, parent_relpath,
-    presence,
-    revnum, kind, checksum, translated_size, changed_rev, changed_date,
-    changed_author, depth, last_mod_time, properties )
-SELECT wc_id, ?1,
-    repos_id, repos_relpath, ?2 AS parent_relpath, presence,
-    revnum, kind, checksum, translated_size, changed_rev, changed_date,
-    changed_author, depth, last_mod_time, properties FROM BASE_NODE
-WHERE local_relpath = '';
-INSERT INTO root.BASE_NODE (
-    wc_id, local_relpath, repos_id, repos_relpath, parent_relpath,
-    presence,
-    revnum, kind, checksum, translated_size, changed_rev, changed_date,
-    changed_author, depth, last_mod_time, properties )
-SELECT wc_id, ?1 || '/' || local_relpath,
-    repos_id, repos_relpath, ?1 AS parent_relpath, presence,
-    revnum, kind, checksum, translated_size, changed_rev, changed_date,
-    changed_author, depth, last_mod_time, properties FROM BASE_NODE
-WHERE local_relpath != '';
-
--- STMT_COPY_WORKING_NODE_TABLE_TO_WCROOT_DB
-INSERT INTO root.WORKING_NODE (
-    wc_id, local_relpath, parent_relpath, presence, kind, checksum,
-    translated_size, changed_rev, changed_date, changed_author, depth,
-    symlink_target, last_mod_time, properties, copyfrom_repos_id,
-    copyfrom_repos_path, copyfrom_revnum )
-SELECT wc_id, ?1, ?2 AS parent_relpath,
-    presence, kind, checksum,
-    translated_size, changed_rev, changed_date, changed_author, depth,
-    symlink_target, last_mod_time, properties, copyfrom_repos_id,
-    copyfrom_repos_path, copyfrom_revnum FROM WORKING_NODE
-WHERE local_relpath = '';
-INSERT INTO root.WORKING_NODE (
-    wc_id, local_relpath, parent_relpath, presence, kind, checksum,
-    translated_size, changed_rev, changed_date, changed_author, depth,
-    symlink_target, last_mod_time, properties, copyfrom_repos_id,
-    copyfrom_repos_path, copyfrom_revnum )
-SELECT wc_id, ?1 || '/' || local_relpath, ?1 AS parent_relpath,
-    presence, kind, checksum,
-    translated_size, changed_rev, changed_date, changed_author, depth,
-    symlink_target, last_mod_time, properties, copyfrom_repos_id,
-    copyfrom_repos_path, copyfrom_revnum FROM WORKING_NODE
-WHERE local_relpath != '';
-/* TODO - maybe: WHERE kind != 'subdir'; */
-
--- STMT_COPY_ACTUAL_NODE_TABLE_TO_WCROOT_DB
-INSERT INTO root.ACTUAL_NODE (
-    wc_id, local_relpath, parent_relpath, properties,
-    conflict_old, conflict_new, conflict_working,
-    prop_reject, changelist, text_mod, tree_conflict_data )
-SELECT wc_id, ?1, ?2 AS parent_relpath, properties,
-     conflict_old, conflict_new, conflict_working,
-     prop_reject, changelist, text_mod, tree_conflict_data FROM ACTUAL_NODE
-WHERE local_relpath = '';
-INSERT INTO root.ACTUAL_NODE (
-    wc_id, local_relpath, parent_relpath, properties,
-    conflict_old, conflict_new, conflict_working,
-    prop_reject, changelist, text_mod, tree_conflict_data )
-SELECT wc_id, ?1 || '/' || local_relpath, ?1 AS parent_relpath, properties,
-     conflict_old, conflict_new, conflict_working,
-     prop_reject, changelist, text_mod, tree_conflict_data FROM ACTUAL_NODE
-WHERE local_relpath != '';
-
--- STMT_COPY_LOCK_TABLE_TO_WCROOT_DB
-INSERT INTO root.LOCK
-SELECT * FROM LOCK;
-
--- STMT_COPY_PRISTINE_TABLE_TO_WCROOT_DB
-INSERT INTO root.PRISTINE
-SELECT * FROM PRISTINE;
-
 
 /* ------------------------------------------------------------------------- */