Dear Wiki user, You have subscribed to a wiki page or wiki category on "Subversion Wiki" for change notification.
The "InheritedProperties" page has been changed by pburba: http://wiki.apache.org/subversion/InheritedProperties?action=diff&rev1=10&rev2=11 Comment: Tweak suggested new APIs to allow retrieval of explicit and/or inherited properties. bar }}} == API Changes == - Rev svn_client_proplist3 to svn_client_proplist4, adding the svn_boolean_t argument '''get_target_inherited_props''': + Rev svn_proplist_receiver_t to svn_proplist_receiver2_t, adding the argument '''apr_hash_t *inherited_prop_hash'''. Also allow the possibility that the existing apr_hash_t *prop_hash argument may be null: + {{{#!cplusplus - '''''### TBD: Do we want to rev svn_proplist_receiver_t so it can differentiate between explicit and inherited properties?''''' - - {{{ /** + * The callback invoked by svn_client_proplist4(). Each invocation + * provides the regular and/or inherited properties of @a path which + * is either a WC path or a URL. If @a prop_hash is not null, then it + * maps explicit property names (char *) to explicit property + * values (svn_string_t *). If @a inherited_prop_hash is not null, + * then it maps inherited property names (char *) to explicit property + * values (svn_string_t *). Use @a pool for all temporary allocations. + * + * @since New in 1.8. + */ + typedef svn_error_t *(*svn_proplist_receiver2_t)( + void *baton, + const char *path, + apr_hash_t *prop_hash, + apr_hash_t *inherited_prop_hash, + apr_pool_t *pool); + }}} + Rev svn_client_proplist3 to svn_client_proplist4, adding the argument svn_boolean_t '''get_target_inherited_props''': + + {{{#!cplusplus + /** - * Invoke @a receiver with @a receiver_baton to return the regular properties + * Invoke @a receiver with @a receiver_baton to return the regular explicit, and - * of @a target, a URL or working copy path. @a receiver will be called - * for each path encountered. + * possibly the inherited, properties of @a target, a URL or working copy path. + * @a receiver will be called for each path encountered. * * @a target is a WC path or a URL. * - * If @a revision->kind is #svn_opt_revision_unspecified, then get + * If @a revision->kind is #svn_opt_revision_unspecified, then get the - * properties from the working copy, if @a target is a working copy - * path, or from the repository head if @a target is a URL. Else get - * the properties as of @a revision. The actual node revision - * selected is determined by the path as it exists in @a peg_revision. - * If @a peg_revision->kind is #svn_opt_revision_unspecified, then it - * defaults to #svn_opt_revision_head for URLs or + * explicit (and possibly the inherited) properties from the working copy, + * if @a target is a working copy path, or from the repository head if + * @a target is a URL. Else get the properties as of @a revision. + * The actual node revision selected is determined by the path as it exists + * in @a peg_revision. If @a peg_revision->kind is + * #svn_opt_revision_unspecified, then it defaults to #svn_opt_revision_head - * #svn_opt_revision_working for WC targets. Use the authentication + * for URLs or #svn_opt_revision_working for WC targets. Use the - * baton cached in @a ctx for authentication if contacting the + * authentication baton cached in @a ctx for authentication if contacting - * repository. + * the repository. * * If @a depth is #svn_depth_empty, list only the properties of * @a target itself. If @a depth is #svn_depth_files, and @@ -218, +237 @@ svn_depth_t depth, const apr_array_header_t *changelists, svn_boolean_t get_target_inherited_props, - svn_proplist_receiver_t receiver, + svn_proplist_receiver2_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); }}} - Rev svn_client_propget4 to svn_client_propget5, adding the svn_boolean_t argument '''get_target_inherited_prop''': + Rev svn_client_propget4 to svn_client_propget5, adding the argument '''svn_string_t **target_inherited_prop''': - {{{ + {{{#!cplusplus /** * Set @a *props to a hash table whose keys are absolute paths or URLs - * of items on which property @a propname is set, and whose values are + * of items on which property @a propname is explicitly set, and whose - * `#svn_string_t *' representing the property value for @a propname + * values are `#svn_string_t *' representing the property value for - * at that path. + * @a propname at that path. + * + * If @a target_inherited_prop is not null, then set + * @a *target_inherited_prop to the value of @a propname which @a target + * inherits from its nearest parent. If @a target is a working copy path, + * then @a target may inherit properties up to the root of the working + * copy. If no inherited properties are found up to the root of the + * working copy, then the the inherited properties cache is checked. + * If @a target is a URL, then @a target may inherit properties up to the + * root of the repository. If no property is inherited, then set + * @a *target_inherited_prop to null. * * Allocate @a *props, its keys, and its values in @a pool, use * @a scratch_pool for temporary allocations. @@ -264, +293 @@ * of one of those changelists. If @a changelists is empty (or * altogether @c NULL), no changelist filtering occurs. * - * If @a get_target_inherited_prop is true, @a propname is an inheritable - * property, and @a propname is not explicitly set on @a target, then also - * include the property value (if any) for @a propname which @a target - * inherits from its nearest parent. Regardless of whether @a target has - * @a propname explicitly set on it or inherits that value, the absolute - * path or URL key in @a *props still corresponds to @a target. - * If @a target is a working copy path, then @a target may inherit - * properties up to the root of the working copy. If no inherited - * properties are found up to the root of the working copy, then the - * the inherited properties cache is checked. If @a target is a URL, - * then @a target may inherit properties up to the root of the repository. - * If @a get_target_inherited_props is false, then no inherited properties - * are included in @a *props. - * * If error, don't touch @a *props, otherwise @a *props is a hash table * even if empty. * @@ -288, +303 @@ */ svn_error_t * svn_client_propget5(apr_hash_t **props, + svn_string_t **target_inherited_prop, const char *propname, const char *target, /* abspath or URL */ const svn_opt_revision_t *peg_revision, @@ -295, +311 @@ svn_revnum_t *actual_revnum, svn_depth_t depth, const apr_array_header_t *changelists, - svn_boolean_t get_target_inherited_prop, svn_client_ctx_t *ctx, apr_pool_t *result_pool, apr_pool_t *scratch_pool); }}} - Rev svn_ra_get_dir2 to svn_ra_get_dir3, adding the svn_boolean_t argument '''get_inherited_props''': + Rev svn_ra_get_dir2 to svn_ra_get_dir3, adding the argument '''apr_hash_t **inherited_props'''.''' '''Also allow the possibility that the existing apr_hash_t **props argument may be null: - {{{ + {{{#!cplusplus /** * If @a dirents is non @c NULL, set @a *dirents to contain all the entries * of directory @a path at @a revision. The keys of @a dirents will be @@ -328, +343 @@ * etc.) The keys are <tt>const char *</tt>, values are * <tt>@c svn_string_t *</tt>. * - * If @a get_inherited_props is true and @a props is non @c NULL, then - * include any props which @a path inherits in @a *props. + * If @a inherited_props is non @c NULL, set @a *inherited_props to contain + * any properties inherited by the directory @a path. The keys are + * <tt>const char *</tt>, values are <tt>@c svn_string_t *</tt>. * * @since New in 1.8. */ @@ -338, +354 @@ apr_hash_t **dirents, svn_revnum_t *fetched_rev, apr_hash_t **props, + apr_hash_t **inherited_props, const char *path, svn_revnum_t revision, apr_uint32_t dirent_fields, - svn_boolean_t get_inherited_props, apr_pool_t *pool); }}} - Rev svn_ra_get_file to svn_ra_get_file2, adding the svn_boolean_t argument '''get_inherited_props''': + Rev svn_ra_get_file to svn_ra_get_file2, adding the argument '''apr_hash_t **inherited_props'''. Also allow the possibility that the existing apr_hash_t **props argument may be null: + {{{#!cplusplus - {{{ - /** - * Fetch the contents and properties of file @a path at @a revision. + /** Fetch the contents and properties of file @a path at @a revision. * @a revision may be SVN_INVALID_REVNUM, indicating that the HEAD * revision should be used. Interpret @a path relative to the URL in * @a session. Use @a pool for all allocations. @@ -367, +382 @@ * etc.) The keys are <tt>const char *</tt>, values are * <tt>@c svn_string_t *</tt>. * - * If @a get_inherited_props is true and @a props is non @c NULL, then - * include any props which @a path inherits in @a *props. + * If @a inherited_props is non @c NULL, set @a *inherited_props to contain + * any properties inherited by the directory @a path. The keys are + * <tt>const char *</tt>, values are <tt>@c svn_string_t *</tt>. * * The stream handlers for @a stream may not perform any RA * operations using @a session. @@ -379, +395 @@ svn_ra_get_file2(svn_ra_session_t *session, const char *path, svn_revnum_t revision, - svn_boolean_t get_inherited_props, svn_stream_t *stream, svn_revnum_t *fetched_rev, apr_hash_t **props, + apr_hash_t **inherited_props, apr_pool_t *pool); }}} - Rev svn_wc_prop_get2 to svn_wc_prop_get3, adding the svn_boolean_t argument '''get_inherited_prop''': + Rev svn_wc_prop_get2 to svn_wc_prop_get3, adding the argument '''svn_string_t **inherited_value'''. Also allow the possibility that the existing svn_string_t **value argument may be null: - '''''### TBD: Do we want another output argument to indicate if *VALUE is inherited or not?''''' + {{{#!cplusplus + /** If @a value is not null, then set @a *value to the value of property + * @a name for @a local_abspath, allocating @a *value in @a result_pool. + * If no such prop, set @a *value to @c NULL. @a name may be a regular or + * wc property; if it is an entry property, return the error + * #SVN_ERR_BAD_PROP_KIND. - {{{ - /** Set @a *value to the value of property @a name for @a local_abspath, - * allocating @a *value in @a result_pool. If no such prop, set @a *value - * to @c NULL. @a name may be a regular or wc property; if it is an + * If @a inherited_value is not null, then set @a *inherited_value to the + * value of property @a name which @a local_abspath inherits from its + * nearest parent, allocating @a *inherited_value in @a result_pool. + * If no such prop is inherited, then set @a *inherited_value to @c NULL. + * @a name may only be a regular property; if it is a wc or entry property, - * entry property, return the error #SVN_ERR_BAD_PROP_KIND. @a wc_ctx + * return the error #SVN_ERR_BAD_PROP_KIND. + * - * is used to access the working copy. + * @a wc_ctx is used to access the working copy. - * - * If @a get_inherited_prop is true, property @a name is not explicitly - * set on @a local_abspath, and @a name is an inheritable property, then - * check if property @a name is inherited from a parent path of @a path. - * If this is the case, set @a *value to the value held by the nearest - * parent of @a path. If no parent is found with property @a name, then - * check the inherited properties cache. * * If @a local_abspath is not a versioned path, return * #SVN_ERR_WC_PATH_NOT_FOUND @@ -410, +426 @@ */ svn_error_t * svn_wc_prop_get3(const svn_string_t **value, + const svn_string_t **inherited_value, svn_wc_context_t *wc_ctx, const char *local_abspath, const char *name, - svn_boolean_t get_inherited_prop, apr_pool_t *result_pool, apr_pool_t *scratch_pool); }}} - Rev svn_fs_node_prop to svn_fs_node_prop2, adding the svn_boolean_t argument '''get_inherited_prop''': + Rev svn_fs_node_prop to svn_fs_node_prop2, adding the argument '''svn_string_t **inherited_value_p'''. Also allow the possibility that the existing svn_string_t **value_p argument may be null: - {{{ - /** Set @a *value_p to the value of the property named @a propname of + {{{#!cplusplus + /** If @a value_p is not null, then set @a *value_p to the value of the + * property named @a propname of @a path in @a root. If the node has no + * property by that name, set @a *value_p to null. + * + * If @a inherited_value_p is not null, then set @a *inherited_value_p to + * the value of the property named @a propname inherited by @a path in - * @a path in @a root. If the node has no property by that name and + * @a root. If the node has no inherited property by that name, set + * @a *inherited_value_p to null. - * @a get_inherited_prop is false, then set @a *value_p to zero. If - * the node has no property by that name, @a propname is an inheritable - * property, and @a get_inherited_prop is true, then set @a *value_p to - * the value (if any) which @a path inherits from its nearest parent. * - * Allocate the result in @a pool. + * Allocate the results in @a pool. * * @since New in 1.8. */ svn_error_t * svn_fs_node_prop2(svn_string_t **value_p, + svn_string_t **inherited_value_p svn_fs_root_t *root, const char *path, const char *propname, svn_boolean_t get_inherited_prop, apr_pool_t *pool); }}} - Rev svn_fs_node_proplist to svn_fs_node_proplist2, adding the svn_boolean_t argument '''get_inherited_props''': + Rev svn_fs_node_proplist to svn_fs_node_proplist2, adding the argument '''apr_hash_t **inherited_table_p'''. Also allow the possibility that the existing apr_hash_t **table_p argument may be null: - {{{ + {{{#!cplusplus + /** If @a table_p is not null, then set @a *table_p to the entire property + * list of @a path in @a root. + * + * If @a inherited_table_p is not null, then set @a *inherited_table_p to - /** Set @a *table_p to the entire property list of @a path in @a root, + * the entire inherited property list of @a path in @a root. - * as an APR hash table allocated in @a pool. The resulting table maps + * - * property names to pointers to #svn_string_t objects containing the + * Both hashes map property names to pointers to #svn_string_t objects + * containing the property value. Both hashes are allocated in @a pool. - * property value. If @a get_inherited_props is true, then any properties - * inherited by @a path are also included in @a *table_p. * * @since New in 1.8. */ svn_error_t * svn_fs_node_proplist2(apr_hash_t **table_p, + apr_hash_t **inherited_table_p, svn_fs_root_t *root, const char *path, - svn_boolean_t get_inherited_props, apr_pool_t *pool); }}} == New APIs == - {{{ + {{{#!cplusplus /** Return @c TRUE iff @a prop_name represents the name of a inheritable * property. *
