Author: hwright
Date: Fri Jun 17 19:17:14 2011
New Revision: 1136989
URL: http://svn.apache.org/viewvc?rev=1136989&view=rev
Log:
For proplist, don't manually filter on our changelists, but take advantage of
the changelist filtering abilities when populating our target list.
* subversion/include/private/svn_wc_private.h
(svn_wc__prop_list_recursive): Add changelists param.
* subversion/libsvn_wc/props.c
(svn_wc__prop_list_recursive): Either manually filter by a changelist, or
pass the list down to the lower layers.
* subversion/libsvn_wc/wc_db.c
(cache_props_baton_t): Add changelists member.
(cache_props_recursive): Provide the changelists list when populating the
targets tree.
(svn_wc__db_read_props_streamily): Put the changelists list in the cache
props baton.
* subversion/libsvn_wc/wc_db.h
(svn_wc__db_read_props_streamily): Add changelists param.
* subversion/libsvn_client/prop_commands.c
(recursive_propget_receiver_baton): Remove changelist hash.
(recursive_propget_receiver): Don't filter by changelist here.
(get_prop_from_wc): Don't copy the changelist hash, but pass it to the WC
function.
(recursive_proplist_receiver_baton): Remove changelist hash.
(recursive_proplist_receiver): Don't filter by changelist.
(svn_client_proplist3): Pass the changelist list to the WC.
Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_client/prop_commands.c
subversion/trunk/subversion/libsvn_wc/props.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1136989&r1=1136988&r2=1136989&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Fri Jun 17
19:17:14 2011
@@ -766,6 +766,8 @@ typedef svn_error_t *(*svn_wc__proplist_
*
* If a node has no properties, @a receiver_func is not called for the node.
*
+ * If @a changelists are non-NULL and non-empty, filter by them.
+ *
* Use @a wc_ctx to access the working copy, and @a scratch_pool for
* temporary allocations.
*
@@ -781,6 +783,7 @@ svn_wc__prop_list_recursive(svn_wc_conte
svn_depth_t depth,
svn_boolean_t base_props,
svn_boolean_t pristine,
+ const apr_array_header_t *changelists,
svn_wc__proplist_receiver_t receiver_func,
void *receiver_baton,
svn_cancel_func_t cancel_func,
Modified: subversion/trunk/subversion/libsvn_client/prop_commands.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/prop_commands.c?rev=1136989&r1=1136988&r2=1136989&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/trunk/subversion/libsvn_client/prop_commands.c Fri Jun 17
19:17:14 2011
@@ -756,7 +756,6 @@ struct recursive_propget_receiver_baton
{
apr_hash_t *props; /* Hash to collect props. */
apr_pool_t *pool; /* Pool to allocate additions to PROPS. */
- apr_hash_t *changelist_hash; /* Keys are changelists to filter on. */
svn_wc_context_t *wc_ctx; /* Working copy context. */
};
@@ -769,11 +768,6 @@ recursive_propget_receiver(void *baton,
{
struct recursive_propget_receiver_baton *b = baton;
- /* If the node doesn't pass changelist filtering, get outta here. */
- if (! svn_wc__changelist_match(b->wc_ctx, local_abspath,
- b->changelist_hash, scratch_pool))
- return SVN_NO_ERROR;
-
if (apr_hash_count(props))
{
apr_hash_index_t *hi = apr_hash_first(scratch_pool, props);
@@ -829,13 +823,13 @@ get_prop_from_wc(apr_hash_t *props,
rb.props = props;
rb.pool = result_pool;
rb.wc_ctx = ctx->wc_ctx;
- rb.changelist_hash = changelist_hash;
/* Fetch the property, recursively or for a single resource. */
if (depth >= svn_depth_files && kind == svn_node_dir)
{
SVN_ERR(svn_wc__prop_list_recursive(ctx->wc_ctx, target_abspath,
propname, depth, FALSE, pristine,
+ changelists,
recursive_propget_receiver, &rb,
ctx->cancel_func, ctx->cancel_baton,
scratch_pool));
@@ -1126,7 +1120,6 @@ remote_proplist(const char *target_prefi
/* Baton for recursive_proplist_receiver(). */
struct recursive_proplist_receiver_baton
{
- apr_hash_t *changelist_hash; /* Keys are changelists to filter on. */
svn_wc_context_t *wc_ctx; /* Working copy context. */
svn_proplist_receiver_t wrapped_receiver; /* Proplist receiver to call. */
void *wrapped_receiver_baton; /* Baton for the proplist receiver. */
@@ -1146,11 +1139,6 @@ recursive_proplist_receiver(void *baton,
struct recursive_proplist_receiver_baton *b = baton;
const char *path;
- /* If the node doesn't pass changelist filtering, get outta here. */
- if (! svn_wc__changelist_match(b->wc_ctx, local_abspath,
- b->changelist_hash, scratch_pool))
- return SVN_NO_ERROR;
-
/* Attempt to convert absolute paths to relative paths for
* presentation purposes, if needed. */
if (b->anchor && b->anchor_abspath)
@@ -1224,7 +1212,6 @@ svn_client_proplist3(const char *path_or
struct recursive_proplist_receiver_baton rb;
rb.wc_ctx = ctx->wc_ctx;
- rb.changelist_hash = changelist_hash;
rb.wrapped_receiver = receiver;
rb.wrapped_receiver_baton = receiver_baton;
@@ -1241,7 +1228,7 @@ svn_client_proplist3(const char *path_or
SVN_ERR(svn_wc__prop_list_recursive(ctx->wc_ctx, local_abspath, NULL,
depth,
- FALSE, pristine,
+ FALSE, pristine, changelists,
recursive_proplist_receiver, &rb,
ctx->cancel_func,
ctx->cancel_baton, pool));
Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=1136989&r1=1136988&r2=1136989&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Fri Jun 17 19:17:14 2011
@@ -1838,6 +1838,7 @@ svn_wc__prop_list_recursive(svn_wc_conte
svn_depth_t depth,
svn_boolean_t base_props,
svn_boolean_t pristine,
+ const apr_array_header_t *changelists,
svn_wc__proplist_receiver_t receiver_func,
void *receiver_baton,
svn_cancel_func_t cancel_func,
@@ -1862,6 +1863,15 @@ svn_wc__prop_list_recursive(svn_wc_conte
case svn_depth_empty:
{
apr_hash_t *props;
+ apr_hash_t *changelist_hash = NULL;
+
+ if (changelists && changelists->nelts)
+ SVN_ERR(svn_hash_from_cstring_keys(&changelist_hash,
+ changelists, scratch_pool));
+
+ if (!svn_wc__internal_changelist_match(wc_ctx->db, local_abspath,
+ changelist_hash, scratch_pool))
+ break;
if (pristine)
SVN_ERR(svn_wc__db_read_pristine_props(&props, wc_ctx->db,
@@ -1881,7 +1891,7 @@ svn_wc__prop_list_recursive(svn_wc_conte
{
SVN_ERR(svn_wc__db_read_props_streamily(wc_ctx->db, local_abspath,
depth, base_props, pristine,
- receiver, baton,
+ changelists, receiver, baton,
cancel_func, cancel_baton,
scratch_pool));
}
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1136989&r1=1136988&r2=1136989&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jun 17 19:17:14 2011
@@ -7370,6 +7370,7 @@ typedef struct cache_props_baton_t
svn_depth_t depth;
svn_boolean_t base_props;
svn_boolean_t pristine;
+ const apr_array_header_t *changelists;
svn_cancel_func_t cancel_func;
void *cancel_baton;
} cache_props_baton_t;
@@ -7385,8 +7386,8 @@ cache_props_recursive(void *cb_baton,
svn_sqlite__stmt_t *stmt;
int stmt_idx;
- SVN_ERR(populate_targets_tree(wcroot, local_relpath, baton->depth, NULL,
- scratch_pool));
+ SVN_ERR(populate_targets_tree(wcroot, local_relpath, baton->depth,
+ baton->changelists, scratch_pool));
SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
STMT_CREATE_NODE_PROPS_CACHE));
@@ -7424,6 +7425,7 @@ svn_wc__db_read_props_streamily(svn_wc__
svn_depth_t depth,
svn_boolean_t base_props,
svn_boolean_t pristine,
+ const apr_array_header_t *changelists,
svn_wc__proplist_receiver_t receiver_func,
void *receiver_baton,
svn_cancel_func_t cancel_func,
@@ -7451,8 +7453,10 @@ svn_wc__db_read_props_streamily(svn_wc__
baton.depth = depth;
baton.base_props = base_props;
baton.pristine = pristine;
+ baton.changelists = changelists;
baton.cancel_func = cancel_func;
baton.cancel_baton = cancel_baton;
+
SVN_ERR(with_finalization(wcroot, local_relpath,
cache_props_recursive, &baton,
NULL, NULL,
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1136989&r1=1136988&r2=1136989&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Fri Jun 17 19:17:14 2011
@@ -1977,6 +1977,7 @@ svn_wc__db_read_props_streamily(svn_wc__
svn_depth_t depth,
svn_boolean_t base_props,
svn_boolean_t pristine,
+ const apr_array_header_t *changelists,
svn_wc__proplist_receiver_t receiver_func,
void *receiver_baton,
svn_cancel_func_t cancel_func,