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/12 19:19:58 UTC
svn commit: r996344 - in /subversion/trunk/subversion/libsvn_wc:
wc-queries.sql wc_db.c
Author: ehu
Date: Sun Sep 12 17:19:57 2010
New Revision: 996344
URL: http://svn.apache.org/viewvc?rev=996344&view=rev
Log:
Two more NODES queries.
* subversion/libsvn_wc/wc_db.c
(STMT_UPDATE_BASE_NODE_DAV_CACHE,
STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE): New.
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_base_set_dav_cache,
svn_wc__db_base_clear_dav_cache_recursive): Add SVN_WC__NODES
sections and mark non-SVN_WC__NODES_ONLY ones.
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=996344&r1=996343&r2=996344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Sun Sep 12 17:19:57 2010
@@ -188,6 +188,10 @@ values (?1);
update base_node set dav_cache = ?3
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_UPDATE_BASE_NODE_DAV_CACHE
+update nodes set dav_cache = ?3
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_SELECT_BASE_DAV_CACHE
select dav_cache from base_node
where wc_id = ?1 and local_relpath = ?2;
@@ -213,6 +217,12 @@ where dav_cache is not null and wc_id =
(local_relpath = ?2 or
local_relpath like ?3 escape '#');
+-- STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE
+update nodes set dav_cache = null
+where dav_cache is not null and wc_id = ?1 and op_depth = 0 and
+ (local_relpath = ?2 or
+ local_relpath like ?3 escape '#');
+
-- STMT_UPDATE_BASE_RECURSIVE_REPO
update base_node set repos_id = ?4
where repos_id is not null and wc_id = ?1 and
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=996344&r1=996343&r2=996344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sun Sep 12 17:19:57 2010
@@ -2399,6 +2399,7 @@ svn_wc__db_base_set_dav_cache(svn_wc__db
svn_sqlite__stmt_t *stmt;
int affected_rows;
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(get_statement_for_path(&stmt, db, local_abspath,
STMT_UPDATE_BASE_DAV_CACHE, scratch_pool));
SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, scratch_pool));
@@ -2410,6 +2411,21 @@ svn_wc__db_base_set_dav_cache(svn_wc__db
_("The node '%s' was not found."),
svn_dirent_local_style(local_abspath,
scratch_pool));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(get_statement_for_path(&stmt, db, local_abspath,
+ STMT_UPDATE_BASE_NODE_DAV_CACHE,
+ scratch_pool));
+ SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, scratch_pool));
+
+ SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+
+ if (affected_rows != 1)
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("The node '%s' was not found."),
+ svn_dirent_local_style(local_abspath,
+ scratch_pool));
+#endif
return SVN_NO_ERROR;
}
@@ -2464,11 +2480,23 @@ svn_wc__db_base_clear_dav_cache_recursiv
escape_sqlite_like(local_relpath, scratch_pool),
"/%", NULL);
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_CLEAR_BASE_RECURSIVE_DAV_CACHE));
SVN_ERR(svn_sqlite__bindf(stmt, "iss", pdh->wcroot->wc_id, local_relpath,
like_arg));
- return svn_error_return(svn_sqlite__step_done(stmt));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "iss", pdh->wcroot->wc_id, local_relpath,
+ like_arg));
+
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
+ return SVN_NO_ERROR;
}
svn_error_t *