Author: rhuijben
Date: Thu May 12 15:38:36 2011
New Revision: 1102353
URL: http://svn.apache.org/viewvc?rev=1102353&view=rev
Log:
Resolve a ### in wc-queries.sql, by making three statements just copy the
origin of a node from one layer to another layer instead of recalculating
them in the c code.
* subversion/libsvn_wc/wc-queries.sql
(STMT_INSERT_WORKING_NODE_COPY_FROM_BASE,
STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING,
STMT_INSERT_WORKING_NODE_COPY_FROM_DEPTH): Copy respos_id, repos_path and
revision instead of taking the values from the c code.
* subversion/libsvn_wc/wc_db.c
(db_op_copy,
db_op_copy_shadowed_layer): Update callers.
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=1102353&r1=1102352&r2=1102353&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu May 12 15:38:36
2011
@@ -731,8 +731,6 @@ SELECT local_relpath FROM nodes
WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
AND op_depth = 0 AND presence = 'absent'
-/* ### Why can't this query not just use the BASE repository
- location values, instead of taking 3 additional parameters?! */
-- STMT_INSERT_WORKING_NODE_COPY_FROM_BASE
INSERT OR REPLACE INTO nodes (
wc_id, local_relpath, op_depth, parent_relpath, repos_id,
@@ -740,7 +738,7 @@ INSERT OR REPLACE INTO nodes (
changed_date, changed_author, checksum, properties, translated_size,
last_mod_time, symlink_target )
SELECT wc_id, ?3 /*local_relpath*/, ?4 /*op_depth*/, ?5 /*parent_relpath*/,
- ?6 /*repos_id*/, ?7 /*repos_path*/, ?8 /*revision*/, ?9 /*presence*/,
depth,
+ repos_id, repos_path, revision, ?6 /*presence*/, depth,
kind, changed_revision, changed_date, changed_author, checksum, properties,
translated_size, last_mod_time, symlink_target
FROM nodes
@@ -753,7 +751,7 @@ INSERT OR REPLACE INTO nodes (
changed_author, checksum, properties, translated_size, last_mod_time,
symlink_target )
SELECT wc_id, ?3 /*local_relpath*/, ?4 /*op_depth*/, ?5 /*parent_relpath*/,
- ?6 /*repos_id*/, ?7 /*repos_path*/, ?8 /*revision*/, ?9 /*presence*/,
depth,
+ repos_id, repos_path, revision, ?6 /*presence*/, depth,
kind, changed_revision, changed_date, changed_author, checksum, properties,
translated_size, last_mod_time, symlink_target
FROM nodes
@@ -768,11 +766,11 @@ INSERT OR REPLACE INTO nodes (
changed_author, checksum, properties, translated_size, last_mod_time,
symlink_target )
SELECT wc_id, ?3 /*local_relpath*/, ?4 /*op_depth*/, ?5 /*parent_relpath*/,
- ?6 /*repos_id*/, ?7 /*repos_path*/, ?8 /*revision*/, ?9 /*presence*/,
+ repos_id, repos_path, revision, ?6 /*presence*/,
depth, kind, changed_revision, changed_date, changed_author, checksum,
properties, translated_size, last_mod_time, symlink_target
FROM nodes
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?10
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?7
-- STMT_INSERT_ACTUAL_NODE_FROM_ACTUAL_NODE
INSERT OR REPLACE INTO actual_node (
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1102353&r1=1102352&r2=1102353&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu May 12 15:38:36 2011
@@ -3734,19 +3734,13 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
STMT_INSERT_WORKING_NODE_COPY_FROM_BASE));
- SVN_ERR(svn_sqlite__bindf(stmt, "issisnnnt",
+ SVN_ERR(svn_sqlite__bindf(stmt, "issist",
src_wcroot->wc_id, src_relpath,
dst_relpath,
dst_op_depth,
dst_parent_relpath,
presence_map, dst_presence));
- if (copyfrom_relpath)
- {
- SVN_ERR(svn_sqlite__bind_int64(stmt, 6, copyfrom_id));
- SVN_ERR(svn_sqlite__bind_text(stmt, 7, copyfrom_relpath));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 8, copyfrom_rev));
- }
SVN_ERR(svn_sqlite__step_done(stmt));
/* ### Copying changelist is OK for a move but what about a copy? */
@@ -4011,21 +4005,15 @@ db_op_copy_shadowed_layer(svn_wc__db_wcr
SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
STMT_INSERT_WORKING_NODE_COPY_FROM_BASE));
- SVN_ERR(svn_sqlite__bindf(stmt, "issisnnnt",
+ SVN_ERR(svn_sqlite__bindf(stmt, "issist",
src_wcroot->wc_id, src_relpath,
dst_relpath,
dst_op_depth,
svn_relpath_basename(dst_relpath, iterpool),
presence_map, dst_presence));
- if (repos_relpath)
- {
- SVN_ERR(svn_sqlite__bind_int64(stmt, 6, repos_id));
- SVN_ERR(svn_sqlite__bind_text(stmt, 7, repos_relpath));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 8, revision));
- }
if (src_op_depth > 0)
- SVN_ERR(svn_sqlite__bind_int64(stmt, 10, src_op_depth));
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 7, src_op_depth));
SVN_ERR(svn_sqlite__step_done(stmt));