You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/05/15 02:21:38 UTC
svn commit: r1103257 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c
wc-queries.sql wc_db.c
Author: hwright
Date: Sun May 15 00:21:37 2011
New Revision: 1103257
URL: http://svn.apache.org/viewvc?rev=1103257&view=rev
Log:
Move the special-cased directory skipping message for changelists to
the wc_db layer.
* subversion/libsvn_wc/adm_ops.c
(changelist_walker): Remove special case for directories.
* subversion/libsvn_wc/wc-queries.sql
(STMT_UPDATE_ACTUAL_CHANGELISTS): Only set changelists on files.
(STMT_MARK_SKIPPED_CHANGELIST_DIRS): New.
(STMT_CREATE_TARGETS_LIST): Also store the kind of the object, and add an
index.
(STMT_INSERT_TARGET): Insert the kind of the object.
* subversion/libsvn_wc/wc_db.c
(populate_targets_tree): Add the wc_id of the object.
(set_changelist_txn): If setting a changelist on a dir, add a skip
notification.
Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1103257&r1=1103256&r2=1103257&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Sun May 15 00:21:37 2011
@@ -2181,19 +2181,6 @@ changelist_walker(const char *local_absp
{
struct changelist_walker_baton *cwb = baton;
- /* We can't add directories to changelists. */
- if (kind == svn_node_dir && cwb->new_changelist)
- {
- if (cwb->notify_func)
- cwb->notify_func(cwb->notify_baton,
- svn_wc_create_notify(local_abspath,
- svn_wc_notify_skip,
- scratch_pool),
- scratch_pool);
-
- return SVN_NO_ERROR;
- }
-
/* Set the changelist. */
SVN_ERR(svn_wc__db_op_set_changelist(cwb->db, local_abspath,
cwb->new_changelist,
Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1103257&r1=1103256&r2=1103257&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Sun May 15 00:21:37 2011
@@ -347,7 +347,12 @@ VALUES (?1, ?2, ?3, ?4)
-- STMT_UPDATE_ACTUAL_CHANGELISTS
UPDATE actual_node SET changelist = ?2
WHERE wc_id = ?1 AND local_relpath IN
-(SELECT local_relpath from targets_list)
+(SELECT local_relpath FROM targets_list WHERE kind = 'file')
+
+-- STMT_MARK_SKIPPED_CHANGELIST_DIRS
+/* 7 corresponds to svn_wc_notify_skip */
+INSERT INTO changelist_list (wc_id, local_relpath, notify, changelist)
+SELECT ?1, local_relpath, 7, ?2 FROM targets_list WHERE kind = 'dir'
-- STMT_RESET_ACTUAL_WITH_CHANGELIST
REPLACE INTO actual_node (
@@ -427,14 +432,18 @@ ORDER BY wc_id, local_relpath
DROP TABLE IF EXISTS targets_list;
CREATE TEMPORARY TABLE targets_list (
local_relpath TEXT NOT NULL,
- parent_relpath TEXT NOT NULL
+ parent_relpath TEXT NOT NULL,
+ kind TEXT NOT NULL
);
+CREATE INDEX targets_list_kind
+ ON targets_list (kind)
-- STMT_DROP_TARGETS_LIST
DROP TABLE IF EXISTS targets_list;
-- STMT_INSERT_TARGET
-INSERT INTO targets_list(local_relpath, parent_relpath) VALUES (?1, ?2)
+INSERT INTO targets_list(local_relpath, parent_relpath, kind)
+SELECT ?2, ?3, kind FROM nodes_current WHERE wc_id = ?1 AND local_relpath = ?2
-- STMT_SELECT_TARGETS
SELECT local_relpath, parent_relpath from targets_list
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1103257&r1=1103256&r2=1103257&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sun May 15 00:21:37 2011
@@ -5005,7 +5005,8 @@ populate_targets_tree(svn_wc__db_wcroot_
/* Insert this single path. */
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_INSERT_TARGET));
- SVN_ERR(svn_sqlite__bindf(stmt, "ss", local_relpath, parent_relpath));
+ SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
+ parent_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
break;
@@ -5082,6 +5083,16 @@ set_changelist_txn(void *baton,
SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, scb->new_changelist));
SVN_ERR(svn_sqlite__step_done(stmt));
+ if (scb->new_changelist)
+ {
+ /* We have to notify that we skipped directories, so do that now. */
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_MARK_SKIPPED_CHANGELIST_DIRS));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+ scb->new_changelist));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+ }
+
/* We may have left empty ACTUAL nodes, so remove it. */
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_DELETE_ACTUAL_EMPTIES));