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/22 17:47:51 UTC
svn commit: r1000055 - in /subversion/trunk/subversion/libsvn_wc:
wc-queries.sql wc_db.c
Author: philip
Date: Wed Sep 22 15:47:50 2010
New Revision: 1000055
URL: http://svn.apache.org/viewvc?rev=1000055&view=rev
Log:
Convert another function for SVN_WC__NODES.
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_scan_deletion): Query NODES table.
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_DELETION_INFO_1): New.
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=1000055&r1=1000054&r2=1000055&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Wed Sep 22 15:47:50 2010
@@ -256,6 +256,19 @@ left outer join base_node on base_node.w
and base_node.local_relpath = working_node.local_relpath
where working_node.wc_id = ?1 and working_node.local_relpath = ?2;
+-- STMT_SELECT_DELETION_INFO_1
+select nodes_base.presence, nodes_work.presence, nodes_work.moved_to
+from nodes nodes_work
+left outer join nodes nodes_base on nodes_base.wc_id = nodes_work.wc_id
+ and nodes_base.local_relpath = nodes_work.local_relpath
+ and nodes_base.op_depth = 0
+where nodes_work.wc_id = ?1 and nodes_work.local_relpath = ?2
+ and nodes_work.op_depth = (select op_depth from nodes
+ where wc_id = ?1 and local_relpath = ?2
+ and op_depth > 0
+ order by op_depth desc
+ limit 1);
+
-- STMT_DELETE_LOCK
delete from lock
where repos_id = ?1 and repos_relpath = ?2;
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1000055&r1=1000054&r2=1000055&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Sep 22 15:47:50 2010
@@ -6882,11 +6882,34 @@ svn_wc__db_scan_deletion(const char **ba
svn_boolean_t have_row;
svn_boolean_t have_base;
svn_wc__db_status_t work_presence;
+#ifdef SVN_WC__NODES
+ svn_sqlite__stmt_t *stmt_nodes;
+ svn_boolean_t have_nodes_row;
+#endif
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_DELETION_INFO));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt_nodes, wcroot->sdb,
+ STMT_SELECT_DELETION_INFO_1));
+ SVN_ERR(svn_sqlite__bindf(stmt_nodes, "is",
+ wcroot->wc_id, current_relpath));
+ SVN_ERR(svn_sqlite__step(&have_nodes_row, stmt_nodes));
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR_ASSERT(svn_sqlite__column_int64(stmt, 0)
+ == svn_sqlite__column_int64(stmt_nodes, 0));
+ SVN_ERR_ASSERT(svn_sqlite__column_int64(stmt, 1)
+ == svn_sqlite__column_int64(stmt_nodes, 1));
+ SVN_ERR(svn_sqlite__reset(stmt_nodes));
+#else
+ stmt = stmt_nodes;
+ have_row = have_nodes_row;
+#endif
+#endif
if (!have_row)
{