You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by eh...@apache.org on 2010/09/10 15:50:01 UTC

svn commit: r995792 - in /subversion/trunk/subversion/libsvn_wc: wc-queries.sql wc_db.c

Author: ehu
Date: Fri Sep 10 13:50:01 2010
New Revision: 995792

URL: http://svn.apache.org/viewvc?rev=995792&view=rev
Log:
Follow up to r995788: fix the tests.

 * subversion/libsvn_wc/wc-queries.c
   (STMT_INSERT_NODE_DATA_INCOMPLETE,
    STMT_DELETE_NODE_DATA_BASE): Remove obsolete queries.
   (STMT_APPLY_CHANGES_TO_BASE): Remove stale comment.
   (STMT_UPDATE_NODE_WORKING_EXCLUDED): Rewrite to NODES as it should
    have been in r995788.

 * subversion/libsvn_wc/wc_db.c
   (set_new_dir_to_incomplete_txn): Mark a section non-NODES_ONLY.


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

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=995792&r1=995791&r2=995792&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Sep 10 13:50:01 2010
@@ -102,11 +102,6 @@ INSERT OR IGNORE INTO WORKING_NODE (
   wc_id, local_relpath, parent_relpath, presence, kind)
 VALUES (?1, ?2, ?3, 'incomplete', 'unknown');
 
--- STMT_INSERT_NODE_DATA_INCOMPLETE
-INSERT OR IGNORE INTO NODE_DATA (
-  wc_id, local_relpath, op_depth, parent_relpath, presence, kind)
-VALUES (?1, ?2, ?3, ?4, 'incomplete', 'unknown');
-
 -- STMT_COUNT_BASE_NODE_CHILDREN
 SELECT COUNT(*) FROM BASE_NODE
 WHERE wc_id = ?1 AND parent_relpath = ?2;
@@ -296,14 +291,6 @@ where wc_id = ?1 and local_relpath = ?2;
 delete from nodes
 where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
 
-/* ### Basically, this query can't exist:
-   we can't be deleting BASE nodes while they still have
-   associated WORKING nodes;
-   at minimum, the op_depth restriction should be removed */
--- STMT_DELETE_NODE_DATA_BASE
-delete from node_data
-where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-
 -- STMT_DELETE_WORKING_NODE
 delete from working_node
 where wc_id = ?1 and local_relpath = ?2;
@@ -353,12 +340,12 @@ UPDATE WORKING_NODE SET presence = 'excl
 WHERE wc_id = ?1 AND local_relpath = ?2;
 
 -- STMT_UPDATE_NODE_WORKING_EXCLUDED
-UPDATE NODE_DATA SET presence = 'excluded', depth = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2 AND
-      op_depth IN (SELECT op_depth FROM NODE_DATA
-                   WHERE wc_id = ?1 AND local_relpath = ?2
-                   ORDER BY op_depth DECSC
-                   LIMIT 1);
+update nodes SET presence = 'excluded', depth = NULL
+where wc_id = ?1 and local_relpath = ?2 and
+      op_depth IN (select op_depth from NODES
+                   where wc_id = ?1 and local_relpath = ?2
+                   order by op_depth DECSC
+                   limit 1);
 
 -- STMT_UPDATE_BASE_PRESENCE
 update base_node set presence= ?3
@@ -492,11 +479,6 @@ WHERE wc_id = ?1 AND local_dir_relpath L
 /* translated_size and last_mod_time are not mentioned here because they will
    be tweaked after the working-file is installed.
    ### what to do about file_external?  */
-/* ### NODE_DATA the fields 'presence', 'kind', 'properties', 'changed_rev',
-   'changed_date', 'changed_author', 'depth', 'symlink_target' - but not:
-   'repos_id', 'repos_relpath', 'dav_cache' - will move to the NODE_DATA
-   table, meaning we can't use this query anymore; we need 2, wrapped in a
-   transaction. */
 INSERT OR REPLACE INTO BASE_NODE (
   wc_id, local_relpath, parent_relpath, presence, kind, revnum, changed_rev,
   changed_author, properties, repos_id, repos_relpath, checksum, changed_date,

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=995792&r1=995791&r2=995792&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Sep 10 13:50:01 2010
@@ -8887,6 +8887,7 @@ set_new_dir_to_incomplete_txn(void *bato
   SVN_ERR(create_repos_id(&repos_id, dtb->repos_root_url, dtb->repos_uuid,
                           sdb, scratch_pool));
 
+#ifndef SVN_WC__NODES_ONLY
   /* Delete the working node */
   SVN_ERR(svn_sqlite__get_statement(&stmt, dtb->pdh->wcroot->sdb,
                                     STMT_DELETE_WORKING_NODE));
@@ -8900,8 +8901,9 @@ set_new_dir_to_incomplete_txn(void *bato
   SVN_ERR(svn_sqlite__bindf(stmt, "is", dtb->pdh->wcroot->wc_id,
                                         dtb->local_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
 
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
   /* Delete the base and working node data */
   SVN_ERR(svn_sqlite__get_statement(&stmt, dtb->pdh->wcroot->sdb,
                                     STMT_DELETE_NODES));
@@ -8931,7 +8933,6 @@ set_new_dir_to_incomplete_txn(void *bato
 
 
 #ifdef SVN_WC__NODES
-
   /* Insert the incomplete base node */
   SVN_ERR(svn_sqlite__get_statement(&stmt, dtb->pdh->wcroot->sdb,
                                     STMT_INSERT_NODE));
@@ -8953,8 +8954,6 @@ set_new_dir_to_incomplete_txn(void *bato
 
 #endif
 
-
-
   return SVN_NO_ERROR;
 }