[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1100733 - in /subversion/trunk/subversion: include/svn_props.h libsvn_subr/properties.c libsvn_wc/update_editor.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sun, 8 May 2011 19:27:06 +0300

rhuijben_at_apache.org wrote on Sun, May 08, 2011 at 13:20:08 -0000:
> Author: rhuijben
> Date: Sun May 8 13:20:08 2011
> New Revision: 1100733
>
> URL: http://svn.apache.org/viewvc?rev=1100733&view=rev
> Log:
> Make a property hash helper function from the update editor public to allow
> using it in other editors.
>
> * subversion/include/svn_props.h
> (svn_prop_array_to_hash): New function.
>
> * subversion/libsvn_subr/properties.c
> (svn_prop_array_to_hash): New function.
>
> * subversion/libsvn_wc/update_editor.c
> (prop_hash_from_array): Remove function (which is now known as
> svn_prop_array_to_hash).
> (close_directory, close_file, svn_wc_add_repos_file4): Update callers.
>
> Modified:
> subversion/trunk/subversion/include/svn_props.h
> subversion/trunk/subversion/libsvn_subr/properties.c
> subversion/trunk/subversion/libsvn_wc/update_editor.c
>
> Modified: subversion/trunk/subversion/include/svn_props.h
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_props.h?rev=1100733&r1=1100732&r2=1100733&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/include/svn_props.h (original)
> +++ subversion/trunk/subversion/include/svn_props.h Sun May 8 13:20:08 2011
> @@ -97,6 +97,16 @@ svn_prop_hash_to_array(apr_hash_t *hash,
> apr_pool_t *pool);
>
> /**
> + * Given an array of svn_prop_t items, return a hash mapping const char *
> + * property names to const svn_string_t * values.
> + *
> + * @since New in 1.7.
> + */
> +apr_hash_t *
> +svn_prop_array_to_hash(const apr_array_header_t *properties,
> + apr_pool_t *result);
> +

How does it handle an svn_prop_t with a NULL 'value' member?

> +/**
> * Creates a deep copy of @a hash (keys <tt>const char *</tt> and
> * values <tt>const svn_string_t</tt>) in @a pool.
> *
>
> Modified: subversion/trunk/subversion/libsvn_subr/properties.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/properties.c?rev=1100733&r1=1100732&r2=1100733&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/properties.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/properties.c Sun May 8 13:20:08 2011
> @@ -221,6 +221,21 @@ svn_prop_diffs(apr_array_header_t **prop
> return SVN_NO_ERROR;
> }
>
> +apr_hash_t *
> +svn_prop_array_to_hash(const apr_array_header_t *properties,
> + apr_pool_t *pool)
> +{
> + int i;
> + apr_hash_t *prop_hash = apr_hash_make(pool);
> +
> + for (i = 0; i < properties->nelts; i++)
> + {
> + const svn_prop_t *prop = &APR_ARRAY_IDX(properties, i, svn_prop_t);
> + apr_hash_set(prop_hash, prop->name, APR_HASH_KEY_STRING, prop->value);
> + }
> +
> + return prop_hash;
> +}
Received on 2011-05-08 18:27:50 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.