You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/10/04 21:27:42 UTC

svn commit: r1004374 - in /subversion/trunk/subversion/libsvn_wc: upgrade.c wc-metadata.sql wc.h

Author: philip
Date: Mon Oct  4 19:27:42 2010
New Revision: 1004374

URL: http://svn.apache.org/viewvc?rev=1004374&view=rev
Log:
Proposed format 19 to 20 upgrade, that's BASE/WORKING to NODES with
temporary 0/2 op_depth.  It's not enabled yet, the default format is
still 19.

* subversion/libsvn_wc/wc.h
  (): Define SVN_WC__NODES and SVN_WC__NODES_ONLY if SVN_WC__VERSION > 19.

* subversion/libsvn_wc/wc-metadata.sql
  (DISABLED_STMT_UPGRADE_TO_20): New.

* subversion/libsvn_wc/upgrade.c
  (bump_to_20): New.
  (svn_wc__upgrade_sdb): Add conditional bump to 20, tweak commented out
   bump_to_XXX code.

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

Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=1004374&r1=1004373&r2=1004374&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Mon Oct  4 19:27:42 2010
@@ -1199,6 +1199,16 @@ bump_to_17(void *baton, svn_sqlite__db_t
   return SVN_NO_ERROR;
 }
 
+#if (SVN_WC__VERSION > 19)
+static svn_error_t *
+bump_to_20(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
+{
+  SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_CREATE_NODES));
+  SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_20));
+  return SVN_NO_ERROR;
+}
+#endif
+
 
 #if 0 /* ### no tree conflict migration yet */
 
@@ -1492,14 +1502,22 @@ svn_wc__upgrade_sdb(int *result_format,
                                    "use 'tools/dev/wc-ng/bump-to-19.py' to "
                                    "upgrade it"), wcroot_abspath);
 
+#if (SVN_WC__VERSION > 19)
+      case 19:
+        SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_20, &bb,
+                                             scratch_pool));
+        *result_format = 20;
+        /* FALLTHROUGH  */
+#endif
+
       /* ### future bumps go here.  */
 #if 0
-      case 98:
+      case XXX-1:
         /* Revamp the recording of tree conflicts.  */
-        SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_XXX,
-                                             (void *)wcroot_abspath,
+        SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_XXX, &bb,
                                              scratch_pool));
-        *result_format = 99;
+        *result_format = XXX;
+        /* FALLTHROUGH  */
 #endif
     }
 

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1004374&r1=1004373&r2=1004374&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Mon Oct  4 19:27:42 2010
@@ -984,6 +984,36 @@ PRAGMA user_version = 17;
 -- STMT_UPGRADE_TO_18
 PRAGMA user_version = 18;
 
+
+/* Format 20 introduces NODES and removes BASE_NODE and WORKING_NODE */
+
+/* ### Enable this bit and take out the BASE_NODE stuff in format 99 below.
+
+-- DISABLED_STMT_UPGRADE_TO_20
+
+INSERT INTO NODES
+SELECT wc_id, local_relpath, 0 AS op_depth, parent_relpath,
+       repos_id, repos_relpath, revnum,
+       presence, depth, NULL AS moved_here, NULL AS moved_to, kind,
+       changed_rev, changed_date, changed_author,
+       checksum, properties, translated_size, last_mod_time,
+       dav_cache, symlink_target, file_external
+FROM BASE_NODE;
+INSERT INTO NODES
+SELECT wc_id, local_relpath, 2 AS op_depth, parent_relpath,
+       copyfrom_repos_id, copyfrom_repos_path, copyfrom_revnum,
+       presence, depth, NULL AS moved_here, NULL AS moved_to, kind,
+       changed_rev, changed_date, changed_author,
+       checksum, properties, translated_size, last_mod_time,
+       NULL AS dav_cache, symlink_target, NULL AS file_external
+FROM WORKING_NODE;
+
+DROP TABLE BASE_NODE;
+DROP TABLE WORKING_NODE;
+
+PRAGMA user_version = 20;
+*/
+
 /* ------------------------------------------------------------------------- */
 
 /* Format YYY introduces new handling for conflict information.  */

Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1004374&r1=1004373&r2=1004374&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Mon Oct  4 19:27:42 2010
@@ -121,6 +121,9 @@ extern "C" {
  * All metadata is held in a single '.svn/wc.db' in the root directory of
  * the working copy.
  *
+ * The change from 19 to 20 introduces NODES and drops BASE_NODE and
+ * WORKING_NODE, op_depth is always 0 or 2. 
+ *
  * == 1.7.x shipped with format ???
  *
  * Please document any further format changes here.
@@ -161,6 +164,11 @@ extern "C" {
 /* A version < this does not store properties in wc.db.  */
 #define SVN_WC__PROPS_IN_DB 18
 
+#if (SVN_WC__VERSION > 19)
+#define SVN_WC__NODES
+#define SVN_WC__NODES_ONLY
+#endif
+
 /* Return true iff error E indicates an "is not a working copy" type
    of error, either because something wasn't a working copy at all, or
    because it's a working copy from a previous version (in need of