You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/04/09 17:20:37 UTC
svn commit: r1585988 - in
/subversion/branches/remote-only-status/subversion: libsvn_wc/
tests/libsvn_client/ tests/libsvn_wc/
Author: brane
Date: Wed Apr 9 15:20:37 2014
New Revision: 1585988
URL: http://svn.apache.org/r1585988
Log:
On the remote-only-status branch: Use new queries that return only BASE
tree info to implement the remote-only status. Reverts most of r1583599.
* subversion/libsvn_wc/wc_db.h
(svn_wc__db_base_read_info, svn_wc__db_base_read_info_fn_t): New.
(svn_wc__db_read_children_info, svn_wc__db_read_single_info):
Added base_tree_only parameter and updated docstrings.
* subversion/libsvn_wc/wc_db.c
(read_info, read_children_info): Added base_tree_only parameter,
and adjusted the implementation to use new queries that only
scan the BASE tree in the wc.db if the parameter is set.
Updated all callers.
(read_single_info,
svn_wc__db_read_single_info,
svn_wc__db_read_children_info): Added base_tree_only parameter.
(read_info_with_txn): New; renamed from svn_wc__db_read_info and
added base_tree_only parameter.
(svn_wc__db_read_info, svn_wc__db_base_read_info): Implemented
as wrappers for read_info_with_txn.
* subversion/libsvn_wc/status.c:
Updated all calls to svn_wc__db_read_children_info() and
svn_wc__db_read_single_info().
(assemble_status): Reverted changes made in r1583599.
(get_dir_status): Likewise.
(internal_status): Use svn_wc__db_base_read_info() when not scanning
the working copy.
(svn_wc_status3): Fixed thinko, pass the correct value to internal_status().
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_BASE_NODE_INFO,
STMT_SELECT_BASE_NODE_INFO_WITH_LOCK,
STMT_SELECT_BASE_NODE_CHILDREN_INFO): New variants of existing statements
that only scan the BASE tree, but otherwise return results in the same
format.
* subversion/tests/libsvn_client/client-test.c
(test_remote_only_status): Adjusted test results for new behaviour of
remote-only status.
* subversion/libsvn_wc/copy.c,
subversion/libsvn_wc/diff_editor.c,
subversion/tests/libsvn_wc/op-depth-test.c:
Update calls to svn_wc__db_read_children_info().
Modified:
subversion/branches/remote-only-status/subversion/libsvn_wc/copy.c
subversion/branches/remote-only-status/subversion/libsvn_wc/diff_editor.c
subversion/branches/remote-only-status/subversion/libsvn_wc/status.c
subversion/branches/remote-only-status/subversion/libsvn_wc/wc-queries.sql
subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.c
subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.h
subversion/branches/remote-only-status/subversion/tests/libsvn_client/client-test.c
subversion/branches/remote-only-status/subversion/tests/libsvn_wc/op-depth-test.c
Modified: subversion/branches/remote-only-status/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_wc/copy.c?rev=1585988&r1=1585987&r2=1585988&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_wc/copy.c Wed Apr 9 15:20:37 2014
@@ -353,6 +353,7 @@ copy_versioned_dir(svn_wc__db_t *db,
SVN_ERR(svn_wc__db_read_children_info(&versioned_children,
&conflicted_children,
db, src_abspath,
+ FALSE /* base_tree_only */,
scratch_pool, iterpool));
for (hi = apr_hash_first(scratch_pool, versioned_children);
hi;
@@ -942,6 +943,7 @@ remove_all_conflict_markers(svn_wc__db_t
artillery. */
SVN_ERR(svn_wc__db_read_children_info(&nodes, &conflicts, db,
src_dir_abspath,
+ FALSE /* base_tree_only */,
scratch_pool, iterpool));
for (hi = apr_hash_first(scratch_pool, nodes);
Modified: subversion/branches/remote-only-status/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_wc/diff_editor.c?rev=1585988&r1=1585987&r2=1585988&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_wc/diff_editor.c Wed Apr 9 15:20:37 2014
@@ -578,6 +578,7 @@ ensure_local_info(struct dir_baton_t *db
SVN_ERR(svn_wc__db_read_children_info(&db->local_info, &conflicts,
db->eb->db, db->local_abspath,
+ FALSE /* base_tree_only */,
db->pool, scratch_pool));
return SVN_NO_ERROR;
@@ -667,6 +668,7 @@ walk_local_nodes_diff(struct edit_baton_
SVN_ERR(svn_wc__db_read_children_info(&nodes, &conflicts,
db, local_abspath,
+ FALSE /* base_tree_only */,
scratch_pool, iterpool));
children = svn_sort__hash(nodes, svn_sort_compare_items_lexically,
@@ -1079,6 +1081,7 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
scratch_pool, iterpool));
SVN_ERR(svn_wc__db_read_children_info(&nodes, &conflicts, db, local_abspath,
+ FALSE /* base_tree_only */,
scratch_pool, iterpool));
if (depth_below_here == svn_depth_immediates)
Modified: subversion/branches/remote-only-status/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_wc/status.c?rev=1585988&r1=1585987&r2=1585988&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_wc/status.c Wed Apr 9 15:20:37 2014
@@ -573,42 +573,7 @@ assemble_status(svn_wc_status3_t **statu
if (below_working != svn_wc__db_status_not_present
&& below_working != svn_wc__db_status_deleted)
{
- if (check_working_copy)
- node_status = svn_wc_status_replaced;
- else
- {
- /* This is a remote-only walk; report the
- base node info instead of the replacement. */
- const char *target;
- const svn_checksum_t *checksum;
- struct svn_wc__db_info_t *base_info =
- apr_palloc(scratch_pool, sizeof(*base_info));
- memcpy(base_info, info, sizeof(*base_info));
- SVN_ERR(svn_wc__db_read_pristine_info(
- &base_info->status,
- &base_info->kind,
- &base_info->changed_rev,
- &base_info->changed_date,
- &base_info->changed_author,
- &base_info->depth,
- &checksum, &target,
- &base_info->had_props, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__db_base_get_info(
- NULL, NULL, &base_info->revnum,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool));
- base_info->has_checksum = (checksum != NULL);
-#ifdef HAVE_SYMLINK
- base_info->special = (target != NULL);
-#endif
- node_status = svn_wc_status_deleted;
- info = base_info;
- }
+ node_status = svn_wc_status_replaced;
}
else
node_status = svn_wc_status_added;
@@ -645,16 +610,6 @@ assemble_status(svn_wc_status3_t **statu
&& prop_status != svn_wc_status_none)
node_status = prop_status;
-
- /* Ignore local additions in remote-only mode */
- if (!check_working_copy
- && node_status == svn_wc_status_added
- && !moved_from_abspath)
- {
- *status = NULL;
- return SVN_NO_ERROR;
- }
-
/* 5. Easy out: unless we're fetching -every- node, don't bother
to allocate a struct for an uninteresting node.
@@ -1305,6 +1260,7 @@ get_dir_status(const struct walk_status_
if (!dir_info)
SVN_ERR(svn_wc__db_read_single_info(&dir_info, wb->db, local_abspath,
+ !wb->check_working_copy,
scratch_pool, iterpool));
SVN_ERR(get_repos_root_url_relpath(&dir_repos_relpath, &dir_repos_root_url,
@@ -1319,6 +1275,7 @@ get_dir_status(const struct walk_status_
hash are subsequently used. */
SVN_ERR(svn_wc__db_read_children_info(&nodes, &conflicts,
wb->db, local_abspath,
+ !wb->check_working_copy,
scratch_pool, iterpool));
all_children = apr_hash_overlay(scratch_pool, nodes, dirents);
@@ -1381,12 +1338,12 @@ get_dir_status(const struct walk_status_
for (i = 0; i < sorted_children->nelts; i++)
{
- const char *child_abspath;
- svn_io_dirent2_t *child_dirent;
- const struct svn_wc__db_info_t *child_info;
const void *key;
apr_ssize_t klen;
svn_sort__item_t item;
+ const char *child_abspath;
+ svn_io_dirent2_t *child_dirent;
+ const struct svn_wc__db_info_t *child_info;
svn_pool_clear(iterpool);
@@ -1406,7 +1363,7 @@ get_dir_status(const struct walk_status_
dir_repos_root_url,
dir_repos_relpath,
dir_repos_uuid,
- (apr_hash_get(conflicts, key, klen) != NULL),
+ apr_hash_get(conflicts, key, klen) != NULL,
&collected_ignore_patterns,
ignore_patterns,
depth,
@@ -1468,6 +1425,7 @@ get_child_status(const struct walk_statu
SVN_ERR(svn_wc__db_read_single_info(&dir_info,
wb->db, parent_abspath,
+ !wb->check_working_copy,
scratch_pool, scratch_pool));
SVN_ERR(get_repos_root_url_relpath(&dir_repos_relpath, &dir_repos_root_url,
@@ -2684,6 +2642,7 @@ svn_wc__internal_walk_status(svn_wc__db_
}
err = svn_wc__db_read_single_info(&info, db, local_abspath,
+ FALSE /* base_tree_only */,
scratch_pool, scratch_pool);
if (err)
@@ -2850,6 +2809,7 @@ internal_status(svn_wc_status3_t **statu
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
err = svn_wc__db_read_single_info(&info, db, local_abspath,
+ !check_working_copy,
scratch_pool, scratch_pool);
if (err)
@@ -2889,17 +2849,18 @@ internal_status(svn_wc_status3_t **statu
these values to determine if a node is switched */
if (!is_root)
{
- const char *parent_abspath = svn_dirent_dirname(local_abspath,
- scratch_pool);
- SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL,
- &parent_repos_relpath,
- &parent_repos_root_url,
- &parent_repos_uuid, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- db, parent_abspath,
- result_pool, scratch_pool));
+ const svn_wc__db_base_read_info_fn_t read_info_fn =
+ (check_working_copy ? svn_wc__db_read_info : svn_wc__db_base_read_info);
+ const char *const parent_abspath = svn_dirent_dirname(local_abspath,
+ scratch_pool);
+ SVN_ERR(read_info_fn(NULL, NULL, NULL,
+ &parent_repos_relpath,
+ &parent_repos_root_url,
+ &parent_repos_uuid,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ db, parent_abspath, result_pool, scratch_pool));
}
else
{
@@ -2929,7 +2890,8 @@ svn_wc_status3(svn_wc_status3_t **status
apr_pool_t *scratch_pool)
{
return svn_error_trace(
- internal_status(status, wc_ctx->db, local_abspath, FALSE,
+ internal_status(status, wc_ctx->db, local_abspath,
+ TRUE /* check_working_copy */,
result_pool, scratch_pool));
}
Modified: subversion/branches/remote-only-status/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_wc/wc-queries.sql?rev=1585988&r1=1585987&r2=1585988&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_wc/wc-queries.sql Wed Apr 9 15:20:37 2014
@@ -35,6 +35,15 @@ FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2
ORDER BY op_depth DESC
+-- STMT_SELECT_BASE_NODE_INFO
+SELECT op_depth, repos_id, repos_path, presence, kind, revision, checksum,
+ translated_size, changed_revision, changed_date, changed_author, depth,
+ symlink_target, last_mod_time, properties, moved_here, inherited_props,
+ moved_to
+ /* All the columns must match those returned by STMT_SELECT_NODE_INFO. */
+FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
+
-- STMT_SELECT_NODE_INFO_WITH_LOCK
SELECT op_depth, nodes.repos_id, nodes.repos_path, presence, kind, revision,
checksum, translated_size, changed_revision, changed_date, changed_author,
@@ -50,6 +59,20 @@ LEFT OUTER JOIN lock ON nodes.repos_id =
WHERE wc_id = ?1 AND local_relpath = ?2
ORDER BY op_depth DESC
+-- STMT_SELECT_BASE_NODE_INFO_WITH_LOCK
+SELECT op_depth, nodes.repos_id, nodes.repos_path, presence, kind, revision,
+ checksum, translated_size, changed_revision, changed_date, changed_author,
+ depth, symlink_target, last_mod_time, properties, moved_here,
+ inherited_props,
+ /* All the columns until now must match those returned by
+ STMT_SELECT_NODE_INFO. The implementation of svn_wc__db_read_info()
+ assumes that these columns are followed by the lock information) */
+ lock_token, lock_owner, lock_comment, lock_date
+FROM nodes
+LEFT OUTER JOIN lock ON nodes.repos_id = lock.repos_id
+ AND nodes.repos_path = lock.repos_relpath
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
+
-- STMT_SELECT_BASE_NODE
SELECT repos_id, repos_path, presence, kind, revision, checksum,
translated_size, changed_revision, changed_date, changed_author, depth,
@@ -138,6 +161,20 @@ LEFT OUTER JOIN lock ON nodes.repos_id =
WHERE wc_id = ?1 AND parent_relpath = ?2
ORDER BY local_relpath DESC, op_depth DESC
+-- STMT_SELECT_BASE_NODE_CHILDREN_INFO
+/* See above re: result ordering. The results of this query must be in
+the same order as returned by STMT_SELECT_NODE_CHILDREN_INFO, because
+read_children_info expects them to be. */
+SELECT op_depth, nodes.repos_id, nodes.repos_path, presence, kind, revision,
+ checksum, translated_size, changed_revision, changed_date, changed_author,
+ depth, symlink_target, last_mod_time, properties, lock_token, lock_owner,
+ lock_comment, lock_date, local_relpath, moved_here, moved_to, file_external
+FROM nodes
+LEFT OUTER JOIN lock ON nodes.repos_id = lock.repos_id
+ AND nodes.repos_path = lock.repos_relpath AND op_depth = 0
+WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0
+ORDER BY local_relpath DESC
+
-- STMT_SELECT_NODE_CHILDREN_WALKER_INFO
SELECT local_relpath, op_depth, presence, kind
FROM nodes_current
Modified: subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.c?rev=1585988&r1=1585987&r2=1585988&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.c Wed Apr 9 15:20:37 2014
@@ -331,6 +331,7 @@ read_info(svn_wc__db_status_t *status,
svn_boolean_t *have_work,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
+ svn_boolean_t base_tree_only,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
@@ -3842,7 +3843,8 @@ cross_db_copy(svn_wc__db_wcroot_t *src_w
&changed_rev, &changed_date, &changed_author, &depth,
&checksum, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- src_wcroot, src_relpath, scratch_pool, scratch_pool));
+ src_wcroot, src_relpath, FALSE /* base_tree_only */,
+ scratch_pool, scratch_pool));
SVN_ERR(db_read_pristine_props(&props, src_wcroot, src_relpath, FALSE,
scratch_pool, scratch_pool));
@@ -4174,7 +4176,9 @@ get_info_for_copy(apr_int64_t *copyfrom_
NULL /* have_base */,
NULL /* have_more_work */,
NULL /* have_work */,
- src_wcroot, local_relpath, result_pool, scratch_pool));
+ src_wcroot, local_relpath,
+ FALSE /* base_tree_only */,
+ result_pool, scratch_pool));
if (op_root)
*op_root = is_op_root;
@@ -4466,7 +4470,8 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
err = read_info(&dst_status, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- dst_wcroot, dst_relpath, scratch_pool, scratch_pool);
+ dst_wcroot, dst_relpath, FALSE /* base_tree_only */,
+ scratch_pool, scratch_pool);
if (err)
{
@@ -7248,7 +7253,7 @@ remove_node_txn(svn_boolean_t *left_chan
SVN_ERR(read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- wcroot, local_relpath,
+ wcroot, local_relpath, FALSE /* base_tree_only */,
scratch_pool, scratch_pool));
if (status == svn_wc__db_status_normal
@@ -8375,7 +8380,8 @@ svn_wc__db_op_delete_many(svn_wc__db_t *
/* Like svn_wc__db_read_info(), but taking WCROOT+LOCAL_RELPATH instead of
- DB+LOCAL_ABSPATH, and outputting repos ids instead of URL+UUID. */
+ DB+LOCAL_ABSPATH, and outputting repos ids instead of URL+UUID.
+ If BASE_TREE_ONLY is set, only the base tree is taken into account. */
static svn_error_t *
read_info(svn_wc__db_status_t *status,
svn_node_kind_t *kind,
@@ -8404,6 +8410,7 @@ read_info(svn_wc__db_status_t *status,
svn_boolean_t *have_work,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
+ svn_boolean_t base_tree_only,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -8415,13 +8422,19 @@ read_info(svn_wc__db_status_t *status,
/* Obtain the most likely to exist record first, to make sure we don't
have to obtain the SQLite read-lock multiple times */
- SVN_ERR(svn_sqlite__get_statement(&stmt_info, wcroot->sdb,
- lock ? STMT_SELECT_NODE_INFO_WITH_LOCK
- : STMT_SELECT_NODE_INFO));
+ SVN_ERR(svn_sqlite__get_statement(
+ &stmt_info, wcroot->sdb,
+ (lock
+ ? (base_tree_only
+ ? STMT_SELECT_BASE_NODE_INFO_WITH_LOCK
+ : STMT_SELECT_NODE_INFO_WITH_LOCK)
+ : (base_tree_only
+ ? STMT_SELECT_BASE_NODE_INFO
+ : STMT_SELECT_NODE_INFO))));
SVN_ERR(svn_sqlite__bindf(stmt_info, "is", wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step(&have_info, stmt_info));
- if (changelist || conflicted || props_mod)
+ if (!base_tree_only && (changelist || conflicted || props_mod))
{
SVN_ERR(svn_sqlite__get_statement(&stmt_act, wcroot->sdb,
STMT_SELECT_ACTUAL_NODE));
@@ -8745,10 +8758,76 @@ svn_wc__db_read_info_internal(svn_wc__db
recorded_size, recorded_time, changelist, conflicted,
op_root, had_props, props_mod,
have_base, have_more_work, have_work,
- wcroot, local_relpath, result_pool, scratch_pool));
+ wcroot, local_relpath, FALSE /* base_tree_only */,
+ result_pool, scratch_pool));
}
+static svn_error_t *
+read_info_with_txn(svn_wc__db_status_t *status,
+ svn_node_kind_t *kind,
+ svn_revnum_t *revision,
+ const char **repos_relpath,
+ const char **repos_root_url,
+ const char **repos_uuid,
+ svn_revnum_t *changed_rev,
+ apr_time_t *changed_date,
+ const char **changed_author,
+ svn_depth_t *depth,
+ const svn_checksum_t **checksum,
+ const char **target,
+ const char **original_repos_relpath,
+ const char **original_root_url,
+ const char **original_uuid,
+ svn_revnum_t *original_revision,
+ svn_wc__db_lock_t **lock,
+ svn_filesize_t *recorded_size,
+ apr_time_t *recorded_time,
+ const char **changelist,
+ svn_boolean_t *conflicted,
+ svn_boolean_t *op_root,
+ svn_boolean_t *have_props,
+ svn_boolean_t *props_mod,
+ svn_boolean_t *have_base,
+ svn_boolean_t *have_more_work,
+ svn_boolean_t *have_work,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ svn_boolean_t base_tree_only,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc__db_wcroot_t *wcroot;
+ const char *local_relpath;
+ apr_int64_t repos_id, original_repos_id;
+
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+
+ SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
+ local_abspath, scratch_pool, scratch_pool));
+ VERIFY_USABLE_WCROOT(wcroot);
+
+ SVN_WC__DB_WITH_TXN4(
+ read_info(status, kind, revision, repos_relpath, &repos_id,
+ changed_rev, changed_date, changed_author,
+ depth, checksum, target, original_repos_relpath,
+ &original_repos_id, original_revision, lock,
+ recorded_size, recorded_time, changelist, conflicted,
+ op_root, have_props, props_mod,
+ have_base, have_more_work, have_work,
+ wcroot, local_relpath, base_tree_only,
+ result_pool, scratch_pool),
+ svn_wc__db_fetch_repos_info(repos_root_url, repos_uuid,
+ wcroot->sdb, repos_id, result_pool),
+ svn_wc__db_fetch_repos_info(original_root_url, original_uuid,
+ wcroot->sdb, original_repos_id,
+ result_pool),
+ SVN_NO_ERROR,
+ wcroot);
+
+ return SVN_NO_ERROR;
+}
+
svn_error_t *
svn_wc__db_read_info(svn_wc__db_status_t *status,
svn_node_kind_t *kind,
@@ -8782,34 +8861,65 @@ svn_wc__db_read_info(svn_wc__db_status_t
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- svn_wc__db_wcroot_t *wcroot;
- const char *local_relpath;
- apr_int64_t repos_id, original_repos_id;
-
- SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
- SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
- local_abspath, scratch_pool, scratch_pool));
- VERIFY_USABLE_WCROOT(wcroot);
-
- SVN_WC__DB_WITH_TXN4(
- read_info(status, kind, revision, repos_relpath, &repos_id,
- changed_rev, changed_date, changed_author,
- depth, checksum, target, original_repos_relpath,
- &original_repos_id, original_revision, lock,
- recorded_size, recorded_time, changelist, conflicted,
- op_root, have_props, props_mod,
- have_base, have_more_work, have_work,
- wcroot, local_relpath, result_pool, scratch_pool),
- svn_wc__db_fetch_repos_info(repos_root_url, repos_uuid,
- wcroot->sdb, repos_id, result_pool),
- svn_wc__db_fetch_repos_info(original_root_url, original_uuid,
- wcroot->sdb, original_repos_id,
- result_pool),
- SVN_NO_ERROR,
- wcroot);
+ return svn_error_trace(read_info_with_txn(
+ status, kind, revision,
+ repos_relpath, repos_root_url, repos_uuid,
+ changed_rev, changed_date, changed_author,
+ depth, checksum, target, original_repos_relpath,
+ original_root_url, original_uuid,
+ original_revision, lock,
+ recorded_size, recorded_time, changelist,
+ conflicted, op_root, have_props, props_mod,
+ have_base, have_more_work, have_work,
+ db, local_abspath, FALSE /* base_tree_only */,
+ result_pool, scratch_pool));
+}
- return SVN_NO_ERROR;
+svn_error_t *
+svn_wc__db_base_read_info(svn_wc__db_status_t *status,
+ svn_node_kind_t *kind,
+ svn_revnum_t *revision,
+ const char **repos_relpath,
+ const char **repos_root_url,
+ const char **repos_uuid,
+ svn_revnum_t *changed_rev,
+ apr_time_t *changed_date,
+ const char **changed_author,
+ svn_depth_t *depth,
+ const svn_checksum_t **checksum,
+ const char **target,
+ const char **original_repos_relpath,
+ const char **original_root_url,
+ const char **original_uuid,
+ svn_revnum_t *original_revision,
+ svn_wc__db_lock_t **lock,
+ svn_filesize_t *recorded_size,
+ apr_time_t *recorded_time,
+ const char **changelist,
+ svn_boolean_t *conflicted,
+ svn_boolean_t *op_root,
+ svn_boolean_t *have_props,
+ svn_boolean_t *props_mod,
+ svn_boolean_t *have_base,
+ svn_boolean_t *have_more_work,
+ svn_boolean_t *have_work,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_trace(read_info_with_txn(
+ status, kind, revision,
+ repos_relpath, repos_root_url, repos_uuid,
+ changed_rev, changed_date, changed_author,
+ depth, checksum, target, original_repos_relpath,
+ original_root_url, original_uuid,
+ original_revision, lock,
+ recorded_size, recorded_time, changelist,
+ conflicted, op_root, have_props, props_mod,
+ have_base, have_more_work, have_work,
+ db, local_abspath, TRUE /* base_tree_only */,
+ result_pool, scratch_pool));
}
static svn_error_t *
@@ -8833,6 +8943,7 @@ read_children_info(svn_wc__db_wcroot_t *
const char *dir_relpath,
apr_hash_t *conflicts,
apr_hash_t *nodes,
+ svn_boolean_t base_tree_only,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -8844,7 +8955,9 @@ read_children_info(svn_wc__db_wcroot_t *
const char *last_repos_root_url = NULL;
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_SELECT_NODE_CHILDREN_INFO));
+ (base_tree_only
+ ? STMT_SELECT_BASE_NODE_CHILDREN_INFO
+ : STMT_SELECT_NODE_CHILDREN_INFO)));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, dir_relpath));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
@@ -8859,7 +8972,7 @@ read_children_info(svn_wc__db_wcroot_t *
int op_depth;
svn_boolean_t new_child;
- child_item = svn_hash_gets(nodes, name);
+ child_item = (base_tree_only ? NULL : svn_hash_gets(nodes, name));
if (child_item)
new_child = FALSE;
else
@@ -9055,54 +9168,58 @@ read_children_info(svn_wc__db_wcroot_t *
SVN_ERR(svn_sqlite__reset(stmt));
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_SELECT_ACTUAL_CHILDREN_INFO));
- SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, dir_relpath));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
-
- while (have_row)
+ if (!base_tree_only)
{
- struct read_children_info_item_t *child_item;
- struct svn_wc__db_info_t *child;
- const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
- const char *name = svn_relpath_basename(child_relpath, NULL);
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_SELECT_ACTUAL_CHILDREN_INFO));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, dir_relpath));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
- child_item = svn_hash_gets(nodes, name);
- if (!child_item)
+ while (have_row)
{
- child_item = apr_pcalloc(result_pool, sizeof(*child_item));
- child_item->info.status = svn_wc__db_status_not_present;
- }
+ struct read_children_info_item_t *child_item;
+ struct svn_wc__db_info_t *child;
+ const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
+ const char *name = svn_relpath_basename(child_relpath, NULL);
+
+ child_item = svn_hash_gets(nodes, name);
+ if (!child_item)
+ {
+ child_item = apr_pcalloc(result_pool, sizeof(*child_item));
+ child_item->info.status = svn_wc__db_status_not_present;
+ }
- child = &child_item->info;
+ child = &child_item->info;
- child->changelist = svn_sqlite__column_text(stmt, 1, result_pool);
+ child->changelist = svn_sqlite__column_text(stmt, 1, result_pool);
- child->props_mod = !svn_sqlite__column_is_null(stmt, 2);
+ child->props_mod = !svn_sqlite__column_is_null(stmt, 2);
#ifdef HAVE_SYMLINK
- if (child->props_mod)
- {
- svn_error_t *err;
- apr_hash_t *properties;
+ if (child->props_mod)
+ {
+ svn_error_t *err;
+ apr_hash_t *properties;
- err = svn_sqlite__column_properties(&properties, stmt, 2,
- scratch_pool, scratch_pool);
- if (err)
- SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
- child->special = (NULL != svn_hash_gets(properties,
- SVN_PROP_SPECIAL));
- }
+ err = svn_sqlite__column_properties(&properties, stmt, 2,
+ scratch_pool, scratch_pool);
+ if (err)
+ SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
+ child->special = (NULL != svn_hash_gets(properties,
+ SVN_PROP_SPECIAL));
+ }
#endif
- child->conflicted = !svn_sqlite__column_is_null(stmt, 3); /* conflict */
+ /* conflict */
+ child->conflicted = !svn_sqlite__column_is_null(stmt, 3);
- if (child->conflicted)
- svn_hash_sets(conflicts, apr_pstrdup(result_pool, name), "");
+ if (child->conflicted)
+ svn_hash_sets(conflicts, apr_pstrdup(result_pool, name), "");
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- }
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ }
- SVN_ERR(svn_sqlite__reset(stmt));
+ SVN_ERR(svn_sqlite__reset(stmt));
+ }
return SVN_NO_ERROR;
}
@@ -9112,6 +9229,7 @@ svn_wc__db_read_children_info(apr_hash_t
apr_hash_t **conflicts,
svn_wc__db_t *db,
const char *dir_abspath,
+ svn_boolean_t base_tree_only,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -9129,7 +9247,7 @@ svn_wc__db_read_children_info(apr_hash_t
SVN_WC__DB_WITH_TXN(
read_children_info(wcroot, dir_relpath, *conflicts, *nodes,
- result_pool, scratch_pool),
+ base_tree_only, result_pool, scratch_pool),
wcroot);
return SVN_NO_ERROR;
@@ -9151,6 +9269,7 @@ static svn_error_t *
read_single_info(const struct svn_wc__db_info_t **info,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
+ svn_boolean_t base_tree_only,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -9170,7 +9289,7 @@ read_single_info(const struct svn_wc__db
&mtb->changelist, &mtb->conflicted, &mtb->op_root,
&mtb->had_props, &mtb->props_mod, &mtb->have_base,
&mtb->have_more_work, &have_work,
- wcroot, local_relpath,
+ wcroot, local_relpath, base_tree_only,
result_pool, scratch_pool));
/* Query the same rows in the database again for move information */
@@ -9284,6 +9403,7 @@ svn_error_t *
svn_wc__db_read_single_info(const struct svn_wc__db_info_t **info,
svn_wc__db_t *db,
const char *local_abspath,
+ svn_boolean_t base_tree_only,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -9298,6 +9418,7 @@ svn_wc__db_read_single_info(const struct
VERIFY_USABLE_WCROOT(wcroot);
SVN_WC__DB_WITH_TXN(read_single_info(info, wcroot, local_relpath,
+ base_tree_only,
result_pool, scratch_pool),
wcroot);
@@ -9617,7 +9738,8 @@ read_url_txn(const char **url,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
&have_base, NULL, NULL,
- wcroot, local_relpath, scratch_pool, scratch_pool));
+ wcroot, local_relpath, FALSE /* base_tree_only */,
+ scratch_pool, scratch_pool));
if (repos_relpath == NULL)
{
@@ -10798,7 +10920,7 @@ relocate_txn(svn_wc__db_wcroot_t *wcroot
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL,
&have_base_node, NULL, NULL,
- wcroot, local_relpath,
+ wcroot, local_relpath, FALSE /* base_tree_only */,
scratch_pool, scratch_pool));
if (status == svn_wc__db_status_excluded)
@@ -10813,7 +10935,7 @@ relocate_txn(svn_wc__db_wcroot_t *wcroot
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL,
- wcroot, parent_relpath,
+ wcroot, parent_relpath, FALSE /* base_tree_only */,
scratch_pool, scratch_pool));
local_dir_relpath = parent_relpath;
}
@@ -13694,7 +13816,7 @@ svn_wc__db_node_hidden(svn_boolean_t *hi
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL,
- wcroot, local_relpath,
+ wcroot, local_relpath, FALSE /* base_tree_only */,
scratch_pool, scratch_pool));
*hidden = (status == svn_wc__db_status_server_excluded
@@ -13755,7 +13877,8 @@ db_is_switched(svn_boolean_t *is_switche
SVN_ERR(read_info(&status, kind, NULL, &repos_relpath, &repos_id, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- wcroot, local_relpath, scratch_pool, scratch_pool));
+ wcroot, local_relpath, FALSE /* base_tree_only */,
+ scratch_pool, scratch_pool));
if (status == svn_wc__db_status_server_excluded
|| status == svn_wc__db_status_excluded
Modified: subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.h?rev=1585988&r1=1585987&r2=1585988&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.h Wed Apr 9 15:20:37 2014
@@ -1926,6 +1926,71 @@ svn_wc__db_read_info(svn_wc__db_status_t
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Like svn_wc__db_read_info, but only retrieves information about the
+ BASE tree. The signature is the same so that these two functions
+ can be interchanged. */
+svn_error_t *
+svn_wc__db_base_read_info(svn_wc__db_status_t *status, /* ### derived */
+ svn_node_kind_t *kind,
+ svn_revnum_t *revision,
+ const char **repos_relpath,
+ const char **repos_root_url,
+ const char **repos_uuid,
+ svn_revnum_t *changed_rev,
+ apr_time_t *changed_date,
+ const char **changed_author,
+ svn_depth_t *depth, /* dirs only */
+ const svn_checksum_t **checksum, /* files only */
+ const char **target, /* symlinks only */
+
+ /* ### the following fields if copied/moved (history) */
+ const char **original_repos_relpath,
+ const char **original_root_url,
+ const char **original_uuid,
+ svn_revnum_t *original_revision,
+
+ /* For BASE nodes */
+ svn_wc__db_lock_t **lock,
+
+ /* Recorded for files present in the working copy */
+ svn_filesize_t *recorded_size,
+ apr_time_t *recorded_time,
+
+ /* From ACTUAL */
+ const char **changelist,
+ svn_boolean_t *conflicted,
+
+ /* ### the followed are derived fields */
+ svn_boolean_t *op_root,
+
+ svn_boolean_t *had_props,
+ svn_boolean_t *props_mod,
+
+ svn_boolean_t *have_base,
+ svn_boolean_t *have_more_work,
+ svn_boolean_t *have_work,
+
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Typedef for the db(_base)_read_info prototype. Used in status.c to
+ declare a reference to either svn_wc__db_read_info or
+ svn_wc__db_base_read_info. */
+typedef svn_error_t *(*svn_wc__db_base_read_info_fn_t)(
+ svn_wc__db_status_t *, svn_node_kind_t *, svn_revnum_t *,
+ const char **, const char **, const char **,
+ svn_revnum_t *, apr_time_t *, const char **,
+ svn_depth_t *, const svn_checksum_t **, const char **,
+ const char **, const char **, const char **, svn_revnum_t *,
+ svn_wc__db_lock_t **, svn_filesize_t *, apr_time_t *,
+ const char **, svn_boolean_t *, svn_boolean_t *,
+ svn_boolean_t *, svn_boolean_t *, svn_boolean_t *,
+ svn_boolean_t *, svn_boolean_t *, svn_wc__db_t *,
+ const char *, apr_pool_t *, apr_pool_t *);
+
+
/* Structure used as linked list in svn_wc__db_info_t to describe all nodes
in this location that were moved to another location */
struct svn_wc__db_moved_to_info_t
@@ -1988,21 +2053,29 @@ struct svn_wc__db_info_t {
The results include any path that was a child of a deleted directory that
existed at LOCAL_ABSPATH, even if that directory is now scheduled to be
replaced by the working node at LOCAL_ABSPATH.
+
+ If BASE_TREE_ONLY is set, only information about the BASE tree
+ is returned.
*/
svn_error_t *
svn_wc__db_read_children_info(apr_hash_t **nodes,
apr_hash_t **conflicts,
svn_wc__db_t *db,
const char *dir_abspath,
+ svn_boolean_t base_tree_only,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
/* Like svn_wc__db_read_children_info, but only gets an info node for the root
- element. */
+ element.
+
+ If BASE_TREE_ONLY is set, only information about the BASE tree
+ is returned. */
svn_error_t *
svn_wc__db_read_single_info(const struct svn_wc__db_info_t **info,
svn_wc__db_t *db,
const char *local_abspath,
+ svn_boolean_t base_tree_only,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
Modified: subversion/branches/remote-only-status/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/tests/libsvn_client/client-test.c?rev=1585988&r1=1585987&r2=1585988&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/remote-only-status/subversion/tests/libsvn_client/client-test.c Wed Apr 9 15:20:37 2014
@@ -890,13 +890,13 @@ test_remote_only_status(const svn_test_o
+1, svn_wc_status_normal, svn_wc_status_normal, svn_wc_status_none,
+2, svn_wc_status_modified, svn_wc_status_modified, svn_wc_status_none },
{ "B",
- +1, svn_wc_status_deleted, svn_wc_status_normal, svn_wc_status_none,
+ +1, svn_wc_status_normal, svn_wc_status_normal, svn_wc_status_none,
+2, svn_wc_status_none, svn_wc_status_none, svn_wc_status_none },
{ "C",
+1, svn_wc_status_normal, svn_wc_status_normal, svn_wc_status_none,
+2, svn_wc_status_deleted, svn_wc_status_none, svn_wc_status_none },
{ "D",
- +1, svn_wc_status_modified, svn_wc_status_normal, svn_wc_status_modified,
+ +1, svn_wc_status_normal, svn_wc_status_normal, svn_wc_status_none,
+2, svn_wc_status_none, svn_wc_status_none, svn_wc_status_none },
{ "epsilon",
-1, svn_wc_status_none, svn_wc_status_none, svn_wc_status_none,
Modified: subversion/branches/remote-only-status/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/tests/libsvn_wc/op-depth-test.c?rev=1585988&r1=1585987&r2=1585988&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/remote-only-status/subversion/tests/libsvn_wc/op-depth-test.c Wed Apr 9 15:20:37 2014
@@ -2772,7 +2772,9 @@ test_children_of_replaced_dir(const svn_
SVN_ERR(CHECK_ARRAY(children_array, working_children_exc_hidden, pool));
SVN_ERR(svn_wc__db_read_children_info(&children_hash, &conflicts_hash,
- b.wc_ctx->db, A_abspath, pool, pool));
+ b.wc_ctx->db, A_abspath,
+ FALSE /* base_tree_only */,
+ pool, pool));
SVN_ERR(CHECK_HASH(children_hash, all_children_inc_hidden, pool));
/* We don't yet have a svn_wc__db_read_children_info2() to test. */