subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1340699 - in /subversion/trunk/subversion/libsvn_wc: wc-queries.sql wc_db.c
Date Sun, 20 May 2012 12:46:17 GMT
Author: rhuijben
Date: Sun May 20 12:46:17 2012
New Revision: 1340699

URL: http://svn.apache.org/viewvc?rev=1340699&view=rev
Log:
Rewrite another query to be able to use a sqlite index.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_HAS_SERVER_EXCLUDED_NODES): Split this query in...
  (STMT_HAS_SERVER_EXCLUDED_DESCENDANTS): ... for normal nodes and ...
  (STMT_WC_HAS_SERVER_EXCLUDED): ... for the wcroot.

* subversion/libsvn_wc/wc_db.c
  (catch_copy_of_server_excluded): Use the right query.
  (delete_node): Use non-wcroot query.

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=1340699&r1=1340698&r2=1340699&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Sun May 20 12:46:17 2012
@@ -887,15 +887,23 @@ WHERE wc_id = ?1
 SELECT 1 FROM nodes WHERE wc_id = ?1 AND local_relpath = ?2
 LIMIT 1
 
--- STMT_HAS_SERVER_EXCLUDED_NODES
+/* Not valid for the wc-root */
+-- STMT_HAS_SERVER_EXCLUDED_DESCENDANTS
 SELECT local_relpath FROM nodes
 WHERE wc_id = ?1
-  AND (?2 = ''
-       OR local_relpath = ?2
-       OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth = 0 AND presence = 'absent'
 LIMIT 1
 
+/* Applies to all nodes in a wc */
+-- STMT_WC_HAS_SERVER_EXCLUDED
+SELECT local_relpath FROM nodes
+WHERE wc_id = ?1
+  AND op_depth = 0 AND presence = 'absent'
+LIMIT 1
+
+
+
 /* ### Select all server-excluded nodes. */
 -- STMT_SELECT_ALL_SERVER_EXCLUDED_NODES
 SELECT local_relpath FROM nodes

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1340699&r1=1340698&r2=1340699&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sun May 20 12:46:17 2012
@@ -4176,7 +4176,9 @@ catch_copy_of_server_excluded(svn_wc__db
   const char *server_excluded_relpath;
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_HAS_SERVER_EXCLUDED_NODES));
+                                    (local_relpath[0] == '\0')
+                                      ? STMT_WC_HAS_SERVER_EXCLUDED
+                                      : STMT_HAS_SERVER_EXCLUDED_DESCENDANTS));
   SVN_ERR(svn_sqlite__bindf(stmt, "is",
                             wcroot->wc_id,
                             local_relpath));
@@ -6460,7 +6462,7 @@ delete_node(void *baton,
   if (status == svn_wc__db_status_normal && kind == svn_kind_dir)
     {
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                        STMT_HAS_SERVER_EXCLUDED_NODES));
+                                        STMT_HAS_SERVER_EXCLUDED_DESCENDANTS));
       SVN_ERR(svn_sqlite__bindf(stmt, "is",
                                 wcroot->wc_id, local_relpath));
       SVN_ERR(svn_sqlite__step(&have_row, stmt));



Mime
View raw message