summaryrefslogtreecommitdiff
path: root/subversion/libsvn_client/prop_commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_client/prop_commands.c')
-rw-r--r--subversion/libsvn_client/prop_commands.c127
1 files changed, 51 insertions, 76 deletions
diff --git a/subversion/libsvn_client/prop_commands.c b/subversion/libsvn_client/prop_commands.c
index 06c4d21..1562966 100644
--- a/subversion/libsvn_client/prop_commands.c
+++ b/subversion/libsvn_client/prop_commands.c
@@ -206,6 +206,7 @@ propset_on_url(const char *propname,
item = svn_client_commit_item3_create(pool);
item->url = target;
+ item->kind = node_kind;
item->state_flags = SVN_CLIENT_COMMIT_ITEM_PROP_MODS;
APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
SVN_ERR(svn_client__get_log_msg(&message, &tmp_file, commit_items,
@@ -240,6 +241,14 @@ propset_on_url(const char *propname,
return svn_error_trace(err);
}
+ if (ctx->notify_func2)
+ {
+ svn_wc_notify_t *notify;
+ notify = svn_wc_create_notify_url(target,
+ svn_wc_notify_commit_finalizing,
+ pool);
+ ctx->notify_func2(ctx->notify_baton2, notify, pool);
+ }
/* Close the edit. */
return editor->close_edit(edit_baton, pool);
}
@@ -485,11 +494,11 @@ svn_client_revprop_set2(const char *propname,
const svn_string_t *unset = NULL;
if (original_propval == NULL)
- old_value_p = NULL;
+ old_value_p = NULL;
else if (original_propval->data == NULL)
- old_value_p = &unset;
+ old_value_p = &unset;
else
- old_value_p = &original_propval;
+ old_value_p = &original_propval;
/* The actual RA call. */
SVN_ERR(svn_ra_change_rev_prop2(ra_session, *set_rev, propname,
@@ -512,45 +521,24 @@ svn_client_revprop_set2(const char *propname,
notify->prop_name = propname;
notify->revision = *set_rev;
- (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+ ctx->notify_func2(ctx->notify_baton2, notify, pool);
}
return SVN_NO_ERROR;
}
-/* Helper for the remote case of svn_client_propget.
- *
- * If PROPS is not null, then get the value of property PROPNAME in REVNUM,
- using RA_LIB and SESSION. Store the value ('svn_string_t *') in PROPS,
- under the path key "TARGET_PREFIX/TARGET_RELATIVE" ('const char *').
- *
- * If INHERITED_PROPS is not null, then set *INHERITED_PROPS to a
- * depth-first ordered array of svn_prop_inherited_item_t * structures
- * representing the PROPNAME properties inherited by the target. If
- * INHERITABLE_PROPS in not null and no inheritable properties are found,
- * then set *INHERITED_PROPS to an empty array.
- *
- * Recurse according to DEPTH, similarly to svn_client_propget3().
- *
- * KIND is the kind of the node at "TARGET_PREFIX/TARGET_RELATIVE".
- * Yes, caller passes this; it makes the recursion more efficient :-).
- *
- * Allocate PROPS and *INHERITED_PROPS in RESULT_POOL, but do all temporary
- * work in SCRATCH_POOL. The two pools can be the same; recursive
- * calls may use a different SCRATCH_POOL, however.
- */
-static svn_error_t *
-remote_propget(apr_hash_t *props,
- apr_array_header_t **inherited_props,
- const char *propname,
- const char *target_prefix,
- const char *target_relative,
- svn_node_kind_t kind,
- svn_revnum_t revnum,
- svn_ra_session_t *ra_session,
- svn_depth_t depth,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_error_t *
+svn_client__remote_propget(apr_hash_t *props,
+ apr_array_header_t **inherited_props,
+ const char *propname,
+ const char *target_prefix,
+ const char *target_relative,
+ svn_node_kind_t kind,
+ svn_revnum_t revnum,
+ svn_ra_session_t *ra_session,
+ svn_depth_t depth,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
apr_hash_t *dirents;
apr_hash_t *prop_hash = NULL;
@@ -587,6 +575,9 @@ remote_propget(apr_hash_t *props,
if (inherited_props)
{
const char *repos_root_url;
+ int i;
+ apr_array_header_t *final_iprops =
+ apr_array_make(result_pool, 1, sizeof(svn_prop_inherited_item_t *));
/* We will filter out all but PROPNAME later, making a final copy
in RESULT_POOL, so pass SCRATCH_POOL for all pools. */
@@ -599,15 +590,8 @@ remote_propget(apr_hash_t *props,
repos_root_url,
scratch_pool,
scratch_pool));
- }
-
- /* Make a copy of any inherited PROPNAME properties in RESULT_POOL. */
- if (inherited_props)
- {
- int i;
- apr_array_header_t *final_iprops =
- apr_array_make(result_pool, 1, sizeof(svn_prop_inherited_item_t *));
+ /* Make a copy of any inherited PROPNAME properties in RESULT_POOL. */
for (i = 0; i < (*inherited_props)->nelts; i++)
{
svn_prop_inherited_item_t *iprop =
@@ -650,8 +634,8 @@ remote_propget(apr_hash_t *props,
hi;
hi = apr_hash_next(hi))
{
- const char *this_name = svn__apr_hash_index_key(hi);
- svn_dirent_t *this_ent = svn__apr_hash_index_val(hi);
+ const char *this_name = apr_hash_this_key(hi);
+ svn_dirent_t *this_ent = apr_hash_this_val(hi);
const char *new_target_relative;
svn_depth_t depth_below_here = depth;
@@ -666,15 +650,15 @@ remote_propget(apr_hash_t *props,
new_target_relative = svn_relpath_join(target_relative, this_name,
iterpool);
- SVN_ERR(remote_propget(props, NULL,
- propname,
- target_prefix,
- new_target_relative,
- this_ent->kind,
- revnum,
- ra_session,
- depth_below_here,
- result_pool, iterpool));
+ SVN_ERR(svn_client__remote_propget(props, NULL,
+ propname,
+ target_prefix,
+ new_target_relative,
+ this_ent->kind,
+ revnum,
+ ra_session,
+ depth_below_here,
+ result_pool, iterpool));
}
svn_pool_destroy(iterpool);
@@ -704,7 +688,7 @@ recursive_propget_receiver(void *baton,
{
apr_hash_index_t *hi = apr_hash_first(scratch_pool, props);
svn_hash_sets(b->props, apr_pstrdup(b->pool, local_abspath),
- svn_string_dup(svn__apr_hash_index_val(hi), b->pool));
+ svn_string_dup(apr_hash_this_val(hi), b->pool));
}
return SVN_NO_ERROR;
@@ -882,13 +866,9 @@ svn_client_propget5(apr_hash_t **props,
if (SVN_CLIENT__REVKIND_NEEDS_WC(peg_revision->kind)
|| SVN_CLIENT__REVKIND_NEEDS_WC(revision->kind))
{
- svn_revnum_t origin_rev;
const char *repos_relpath;
const char *repos_root_url;
- const char *repos_uuid;
const char *local_abspath;
- const char *copy_root_abspath;
- svn_boolean_t is_copy;
/* Avoid assertion on the next line when somebody accidentally asks for
a working copy revision on a URL */
@@ -901,12 +881,10 @@ svn_client_propget5(apr_hash_t **props,
if (SVN_CLIENT__REVKIND_NEEDS_WC(peg_revision->kind))
{
- SVN_ERR(svn_wc__node_get_origin(&is_copy,
- &origin_rev,
+ SVN_ERR(svn_wc__node_get_origin(NULL, NULL,
&repos_relpath,
&repos_root_url,
- &repos_uuid,
- &copy_root_abspath,
+ NULL, NULL, NULL,
ctx->wc_ctx,
local_abspath,
FALSE, /* scan_deleted */
@@ -970,7 +948,8 @@ svn_client_propget5(apr_hash_t **props,
if (!local_explicit_props)
*props = apr_hash_make(result_pool);
- SVN_ERR(remote_propget(!local_explicit_props ? *props : NULL,
+ SVN_ERR(svn_client__remote_propget(
+ !local_explicit_props ? *props : NULL,
!local_iprops ? inherited_props : NULL,
propname, loc->url, "",
kind, loc->rev, ra_session,
@@ -1134,8 +1113,8 @@ remote_proplist(const char *target_prefix,
hi;
hi = apr_hash_next(hi))
{
- const char *name = svn__apr_hash_index_key(hi);
- apr_ssize_t klen = svn__apr_hash_index_klen(hi);
+ const char *name = apr_hash_this_key(hi);
+ apr_ssize_t klen = apr_hash_this_key_len(hi);
svn_prop_kind_t prop_kind;
prop_kind = svn_property_kind2(name);
@@ -1160,8 +1139,8 @@ remote_proplist(const char *target_prefix,
hi;
hi = apr_hash_next(hi))
{
- const char *this_name = svn__apr_hash_index_key(hi);
- svn_dirent_t *this_ent = svn__apr_hash_index_val(hi);
+ const char *this_name = apr_hash_this_key(hi);
+ svn_dirent_t *this_ent = apr_hash_this_val(hi);
const char *new_target_relative;
if (cancel_func)
@@ -1291,12 +1270,9 @@ get_remote_props(const char *path_or_url,
if (SVN_CLIENT__REVKIND_NEEDS_WC(peg_revision->kind)
|| SVN_CLIENT__REVKIND_NEEDS_WC(revision->kind))
{
- svn_revnum_t origin_rev;
const char *repos_relpath;
const char *repos_root_url;
- const char *repos_uuid;
const char *local_abspath;
- const char *copy_root_abspath;
svn_boolean_t is_copy;
/* Avoid assertion on the next line when somebody accidentally asks for
@@ -1311,11 +1287,10 @@ get_remote_props(const char *path_or_url,
if (SVN_CLIENT__REVKIND_NEEDS_WC(peg_revision->kind))
{
SVN_ERR(svn_wc__node_get_origin(&is_copy,
- &origin_rev,
+ NULL,
&repos_relpath,
&repos_root_url,
- &repos_uuid,
- &copy_root_abspath,
+ NULL, NULL, NULL,
ctx->wc_ctx,
local_abspath,
FALSE, /* scan_deleted */