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/09/21 12:30:48 UTC

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

Author: philip
Date: Tue Sep 21 10:30:47 2010
New Revision: 999302

URL: http://svn.apache.org/viewvc?rev=999302&view=rev
Log:
Make a simple SVN_WC__NODES_ONLY checkout work.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_DETERMINE_TREE_FOR_RECORDING_1): New.

* subversion/libsvn_wc/wc_db.c
  (which_trees_exist): Query the NODES table.
  (svn_wc__db_temp_op_set_base_incomplete): Use the nodes result
   if SVN_WC__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=999302&r1=999301&r2=999302&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Tue Sep 21 10:30:47 2010
@@ -650,6 +650,15 @@ SELECT 0 FROM BASE_NODE WHERE wc_id = ?1
 UNION
 SELECT 1 FROM WORKING_NODE WHERE wc_id = ?1 AND local_relpath = ?2;
 
+-- STMT_DETERMINE_TREE_FOR_RECORDING_1
+SELECT 0 FROM NODES WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
+UNION
+SELECT 1 FROM NODES 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 DESC
+                   LIMIT 1);
+
 
 /* ### Why can't this query not just use the BASE repository
    location values, instead of taking 3 additional parameters?! */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=999302&r1=999301&r2=999302&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Sep 21 10:30:47 2010
@@ -1457,15 +1457,34 @@ which_trees_exist(svn_boolean_t *base_ex
 {
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
+#ifdef SVN_WC__NODES
+  svn_sqlite__stmt_t *stmt_nodes;
+  svn_boolean_t have_nodes_row;
+#endif
 
   *base_exists = FALSE;
   *working_exists = FALSE;
 
+#ifndef SVN_WC__NODES_ONLY
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
                                     STMT_DETERMINE_TREE_FOR_RECORDING));
   SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
-
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
+#endif
+
+#ifdef SVN_WC__NODES
+  SVN_ERR(svn_sqlite__get_statement(&stmt_nodes, sdb,
+                                    STMT_DETERMINE_TREE_FOR_RECORDING_1));
+  SVN_ERR(svn_sqlite__bindf(stmt_nodes, "is", wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__step(&have_nodes_row, stmt_nodes));
+#ifndef SVN_WC__NODES_ONLY
+  SVN_ERR(svn_sqlite__reset(stmt_nodes));
+#else
+  stmt = stmt_nodes;
+  have_row = have_nodes_row;
+#endif
+#endif
+
   if (have_row)
     {
       int value = svn_sqlite__column_int(stmt, 0);
@@ -8355,7 +8374,11 @@ svn_wc__db_temp_op_set_base_incomplete(s
   SVN_ERR(svn_sqlite__bind_text(stmt, 3, incomplete ? "incomplete" : "normal"));
   SVN_ERR(svn_sqlite__update(&affected_node_rows, stmt));
 
+#ifndef SVN_WC__NODES_ONLY
   SVN_ERR_ASSERT(affected_rows == affected_node_rows);
+#else
+  affected_rows = affected_node_rows;
+#endif
 #endif
 
   if (affected_rows > 0)