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 2012/03/13 18:34:44 UTC
svn commit: r1300252 - in
/subversion/branches/multi-layer-moves/subversion/libsvn_wc: wc-queries.sql
wc_db.c
Author: philip
Date: Tue Mar 13 17:34:44 2012
New Revision: 1300252
URL: http://svn.apache.org/viewvc?rev=1300252&view=rev
Log:
On multi-layer-move branch, start updating WORKING moved-to for
children of moved tree.
* subversion/libsvn_wc/wc_db.c
(delete_node): Allow moved-to of a child of a move to get moved to a
row with a different local_relpath.
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_MOVED_PAIR): Select more rows.
Modified:
subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc-queries.sql
subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c
Modified: subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc-queries.sql?rev=1300252&r1=1300251&r2=1300252&view=diff
==============================================================================
--- subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc-queries.sql Tue Mar 13 17:34:44 2012
@@ -1402,21 +1402,13 @@ SELECT moved_to, local_relpath FROM node
WHERE wc_id = ?1 AND op_depth > 0
AND IS_STRICT_DESCENDANT_OF(moved_to, ?2)
-/* This statement returns pairs of move-roots below the path ?2 in WC_ID ?1,
- * where the destination of the move is within the subtree rooted at path ?2,
- * and the source of the move either lies outside of the subtree rooted at
- * path ?2 or is not visible in the WORKING tree rooted at path ?2.
- * It also returns the op-depth of the source of the move. */
+/* This statement returns pairs of paths that define a move where the
+ destination of the move is within the subtree rooted at path ?2 in
+ WC_ID ?1. */
-- STMT_SELECT_MOVED_PAIR
SELECT local_relpath, moved_to, op_depth FROM nodes_current
WHERE wc_id = ?1
AND IS_STRICT_DESCENDANT_OF(moved_to, ?2)
- AND (NOT IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
- OR NOT EXISTS (SELECT 1 FROM nodes
- WHERE wc_id = ?1
- AND local_relpath = nodes_current.local_relpath
- AND op_depth > ?3
- AND op_depth < nodes_current.op_depth))
/* This statement returns pairs of move-roots below the path ?2 in WC_ID ?1,
* where the source of the move is within the subtree rooted at path ?2, and
Modified: subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c?rev=1300252&r1=1300251&r2=1300252&view=diff
==============================================================================
--- subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c Tue Mar 13 17:34:44 2012
@@ -6430,21 +6430,21 @@ delete_node(void *baton,
APR_ARRAY_PUSH(moved_nodes, const struct moved_node_t *) = moved_node;
/* If a subtree is being moved-away, we need to update moved-to
- * information for all children that were moved into this subtree. */
+ * information for all children that were moved into, or within,
+ * this subtree. */
if (kind == svn_kind_dir)
{
- apr_pool_t *iterpool;
-
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_MOVED_PAIR));
- SVN_ERR(svn_sqlite__bindf(stmt, "isi", wcroot->wc_id, local_relpath,
- b->delete_depth));
-
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
- iterpool = svn_pool_create(scratch_pool);
while (have_row)
{
+ const char *move_relpath
+ = svn_sqlite__column_text(stmt, 0, NULL);
+ const char *move_subtree_relpath
+ = svn_relpath_skip_ancestor(local_relpath, move_relpath);
const char *child_moved_to
= svn_sqlite__column_text(stmt, 1, NULL);
const char *child_moved_to_subtree_relpath
@@ -6453,8 +6453,13 @@ delete_node(void *baton,
moved_node = apr_palloc(scratch_pool,
sizeof(struct moved_node_t));
- moved_node->local_relpath
- = svn_sqlite__column_text(stmt, 0, scratch_pool);
+ if (move_subtree_relpath)
+ moved_node->local_relpath
+ = svn_relpath_join(b->moved_to_relpath,
+ move_subtree_relpath, scratch_pool);
+ else
+ moved_node->local_relpath
+ = apr_pstrdup(scratch_pool, move_relpath);
if (child_moved_to_subtree_relpath)
moved_node->moved_to_relpath
@@ -6477,8 +6482,6 @@ delete_node(void *baton,
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
- svn_pool_destroy(iterpool);
-
SVN_ERR(svn_sqlite__reset(stmt));
}
}