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);
+
+/**
* 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;
+}
svn_boolean_t
svn_prop_is_boolean(const char *prop_name)
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1100733&r1=1100732&r2=1100733&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sun May 8 13:20:08
2011
@@ -2244,22 +2244,6 @@ externals_prop_changed(const apr_array_h
}
-/* Create in POOL a name->value hash from PROP_LIST, and return it. */
-static apr_hash_t *
-prop_hash_from_array(const apr_array_header_t *prop_list,
- apr_pool_t *pool)
-{
- int i;
- apr_hash_t *prop_hash = apr_hash_make(pool);
-
- for (i = 0; i < prop_list->nelts; i++)
- {
- const svn_prop_t *prop = &APR_ARRAY_IDX(prop_list, i, svn_prop_t);
- apr_hash_set(prop_hash, prop->name, APR_HASH_KEY_STRING, prop->value);
- }
-
- return prop_hash;
-}
/* An svn_delta_editor_t function. */
static svn_error_t *
@@ -2515,7 +2499,7 @@ close_directory(void *dir_baton,
NULL /* children */,
depth,
(dav_prop_changes && dav_prop_changes->nelts > 0)
- ? prop_hash_from_array(dav_prop_changes, pool)
+ ? svn_prop_array_to_hash(dav_prop_changes, pool)
: NULL,
NULL /* conflict */,
(! db->shadowed) && new_base_props != NULL,
@@ -3951,8 +3935,9 @@ close_file(void *file_baton,
new_checksum,
(dav_prop_changes
&& dav_prop_changes->nelts > 0)
- ? prop_hash_from_array(dav_prop_changes,
- scratch_pool)
+ ? svn_prop_array_to_hash(
+ dav_prop_changes,
+ scratch_pool)
: NULL,
NULL /* conflict */,
(! fb->shadowed) && new_base_props,
@@ -4861,7 +4846,7 @@ svn_wc_add_repos_file4(svn_wc_context_t
pool));
/* Put regular props back into a hash table. */
- new_base_props = prop_hash_from_array(regular_props, pool);
+ new_base_props = svn_prop_array_to_hash(regular_props, pool);
/* Get the change_* info from the entry props. */
SVN_ERR(accumulate_last_change(&changed_rev,