You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/11/25 12:34:14 UTC
svn commit: r1039007 - in /subversion/trunk/subversion/libsvn_wc:
wc-queries.sql wc_db.c
Author: julianfoad
Date: Thu Nov 25 11:34:14 2010
New Revision: 1039007
URL: http://svn.apache.org/viewvc?rev=1039007&view=rev
Log:
Use gather_repo_children(op_depth=0) instead of gather_children(base_only=TRUE)
and remove that base_only parameter. This is just a small simplification.
* subversion/libsvn_wc/wc_db.c
(gather_children): Remove the 'base_only' parameter, as that case can now
be handled by gather_repo_children(op_depth=0).
(svn_wc__db_base_get_children, make_copy_txn): Replace
gather_children(base_only=TRUE) with gather_repo_children(op_depth=0).
(svn_wc__db_read_children): Adjust the gather_children() call.
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_BASE_NODE_CHILDREN): Remove.
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=1039007&r1=1039006&r2=1039007&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu Nov 25 11:34:14 2010
@@ -132,10 +132,6 @@ INSERT OR REPLACE INTO nodes (
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
?15, ?16, ?17, ?18, ?19);
--- STMT_SELECT_BASE_NODE_CHILDREN
-SELECT local_relpath FROM nodes
-WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0;
-
-- STMT_SELECT_OP_DEPTH_CHILDREN
SELECT local_relpath FROM nodes
WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = ?3;
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1039007&r1=1039006&r2=1039007&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Nov 25 11:34:14 2010
@@ -1065,13 +1065,10 @@ add_children_to_hash(apr_hash_t *childre
}
-/* Return in *CHILDREN all of the children of the directory LOCAL_RELPATH.
- If BASE_ONLY is true, then *only* the children from BASE_NODE are
- returned (those in WORKING_NODE are ignored). The result children are
- allocated in RESULT_POOL. */
+/* Return in *CHILDREN all of the children of the directory LOCAL_RELPATH,
+ of any status, in all op-depths in the NODES table. */
static svn_error_t *
gather_children(const apr_array_header_t **children,
- svn_boolean_t base_only,
svn_wc__db_pdh_t *pdh,
const char *local_relpath,
apr_pool_t *result_pool,
@@ -1080,17 +1077,12 @@ gather_children(const apr_array_header_t
apr_hash_t *names_hash = apr_hash_make(scratch_pool);
apr_array_header_t *names_array;
- /* All of the names get allocated in RESULT_POOL. For !base_only it
+ /* All of the names get allocated in RESULT_POOL. It
appears to be faster to use the hash to remove duplicates than to
use DISTINCT in the SQL query. */
- if (base_only)
- SVN_ERR(add_children_to_hash(names_hash, STMT_SELECT_BASE_NODE_CHILDREN,
- pdh->wcroot->sdb, pdh->wcroot->wc_id,
- local_relpath, result_pool));
- else
- SVN_ERR(add_children_to_hash(names_hash, STMT_SELECT_NODE_CHILDREN,
- pdh->wcroot->sdb, pdh->wcroot->wc_id,
- local_relpath, result_pool));
+ SVN_ERR(add_children_to_hash(names_hash, STMT_SELECT_NODE_CHILDREN,
+ pdh->wcroot->sdb, pdh->wcroot->wc_id,
+ local_relpath, result_pool));
SVN_ERR(svn_hash_keys(&names_array, names_hash, result_pool));
*children = names_array;
@@ -2203,8 +2195,8 @@ svn_wc__db_base_get_children(const apr_a
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(pdh);
- return gather_children(children, TRUE,
- pdh, local_relpath, result_pool, scratch_pool);
+ return gather_repo_children(children, pdh, local_relpath, 0,
+ result_pool, scratch_pool);
}
@@ -5885,7 +5877,7 @@ svn_wc__db_read_children(const apr_array
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(pdh);
- return gather_children(children, FALSE,
+ return gather_children(children,
pdh, local_relpath, result_pool, scratch_pool);
}
@@ -8948,8 +8940,8 @@ make_copy_txn(void *baton,
SVN_ERR(svn_sqlite__reset(stmt));
/* Get the BASE children, as WORKING children don't need modifications */
- SVN_ERR(gather_children(&children, TRUE, mcb->pdh, mcb->local_relpath,
- scratch_pool, iterpool));
+ SVN_ERR(gather_repo_children(&children, mcb->pdh, mcb->local_relpath, 0,
+ scratch_pool, iterpool));
for (i = 0; i < children->nelts; i++)
{