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

Re: svn commit: r35363 - in trunk/subversion: include libsvn_client libsvn_wc svn

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 21 Jan 2009 15:22:24 +0000

Bert Huijben wrote:
> Author: rhuijben
> Date: Wed Jan 21 06:03:13 2009
> New Revision: 35363
>
> Log:
> Provide information in svn_wc_notify_t on whether the notification is about
> a path or an url. This allows us to backwards compatible avoid invalid paths
> from the notifications.
>
> * subversion/include/svn_wc.h
> (svn_wc_notify_t): Add new url field and document path as "." or another valid path
> when the url is set, because path is documented to always specify a valid absolute
> or relative path.
> (svn_wc_create_notify_url): New function.
> * subversion/libsvn_wc/util.c
> (svn_wc_create_notify_url): New function.
> (svn_wc_dup_notify): Make copy of url if set.
> * subversion/svn/notify.c
> (notify): Use url for notifications when available, otherwise use path.
> * subversion/libsvn_client/prop_commands.c
> (svn_client_revprop_set2): Use svn_wc_create_notify_url for url notification.
>
> Modified:
> trunk/subversion/include/svn_wc.h
> trunk/subversion/libsvn_client/prop_commands.c
> trunk/subversion/libsvn_wc/util.c
> trunk/subversion/svn/notify.c
>
> Modified: trunk/subversion/include/svn_wc.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_wc.h?pathrev=35363&r1=35362&r2=35363
> ==============================================================================
> --- trunk/subversion/include/svn_wc.h Wed Jan 21 04:35:42 2009 (r35362)
> +++ trunk/subversion/include/svn_wc.h Wed Jan 21 06:03:13 2009 (r35363)
> @@ -940,14 +940,17 @@ typedef enum svn_wc_notify_lock_state_t
> * give a less informative notification).
> *
> * @note Callers of notification functions should use svn_wc_create_notify()
> - * to create structures of this type to allow for extensibility.
> + * or svn_wc_create_notify_url() to create structures of this type to allow
> + * for extensibility.
> *
> * @since New in 1.2.
> */
> typedef struct svn_wc_notify_t {
>
> /** Path, either absolute or relative to the current working directory
> - * (i.e., not relative to an anchor). */
> + * (i.e., not relative to an anchor)._at_c path is "." or another valid path
> + * value for compatibilty reasons when the real target is an url that
> + * is available in @c url. */
> const char *path;
>
> /** Action that describes what happened to @c path. */
> @@ -995,9 +998,13 @@ typedef struct svn_wc_notify_t {
> * other cases, it is @c NULL. @since New in 1.5 */
> svn_merge_range_t *merge_range;
>
> + /** Similar to @c path, but if non-NULL the notification is about a url.
> + * @since New in 1.6 */
> + const char *url;
> +
> /** If non-NULL, specifies an absolute path prefix that can be subtracted
> - * from the start of the absolute path in @c path. Its purpose is to
> - * allow notification to remove a common prefix from all the paths
> + * from the start of the absolute path in @c path or @c url. Its purpose
> + * is to allow notification to remove a common prefix from all the paths
> * displayed for an operation. @since New in 1.6 */
> const char *path_prefix;
>
> @@ -1027,6 +1034,22 @@ svn_wc_create_notify(const char *path,
> apr_pool_t *pool);
>
> /**
> + * Allocate an @c svn_wc_notify_t structure in @a pool, initialize and return
> + * it.
> + *
> + * Set the @c url field of the created struct to @a url, @c action to, @c path
> + * to "." and @a action. Set all other fields to their @c _unknown, @c NULL or

There are some words missing or mixed up in that first sentence.

- Julian

> + * invalid value, respectively. Make only a shallow copy of the pointer
> + * @a url.
> + *
> + * @since New in 1.6.
> + */
> +svn_wc_notify_t *
> +svn_wc_create_notify_url(const char *url,
> + svn_wc_notify_action_t action,
> + apr_pool_t *pool);
> +
> +/**
> * Return a deep copy of @a notify, allocated in @a pool.
> *
> * @since New in 1.2.
>
> Modified: trunk/subversion/libsvn_client/prop_commands.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/prop_commands.c?pathrev=35363&r1=35362&r2=35363
> ==============================================================================
> --- trunk/subversion/libsvn_client/prop_commands.c Wed Jan 21 04:35:42 2009 (r35362)
> +++ trunk/subversion/libsvn_client/prop_commands.c Wed Jan 21 06:03:13 2009 (r35363)
> @@ -484,7 +484,7 @@ svn_client_revprop_set2(const char *prop
>
> if (ctx->notify_func2)
> {
> - svn_wc_notify_t *notify = svn_wc_create_notify(URL,
> + svn_wc_notify_t *notify = svn_wc_create_notify_url(URL,
> propval == NULL
> ? svn_wc_notify_revprop_set
> : svn_wc_notify_revprop_deleted,
>
> Modified: trunk/subversion/libsvn_wc/util.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/util.c?pathrev=35363&r1=35362&r2=35363
> ==============================================================================
> --- trunk/subversion/libsvn_wc/util.c Wed Jan 21 04:35:42 2009 (r35362)
> +++ trunk/subversion/libsvn_wc/util.c Wed Jan 21 06:03:13 2009 (r35363)
> @@ -133,6 +133,17 @@ svn_wc_create_notify(const char *path,
> return ret;
> }
>
> +svn_wc_notify_t *
> +svn_wc_create_notify_url(const char *url,
> + svn_wc_notify_action_t action,
> + apr_pool_t *pool)
> +{
> + svn_wc_notify_t *ret = svn_wc_create_notify(".", action, pool);
> + ret->url = url;
> +
> + return ret;
> +}
> +
> /* Pool cleanup function to clear an svn_error_t *. */
> static apr_status_t err_cleanup(void *data)
> {
> @@ -165,6 +176,8 @@ svn_wc_dup_notify(const svn_wc_notify_t
> ret->changelist_name = apr_pstrdup(pool, ret->changelist_name);
> if (ret->merge_range)
> ret->merge_range = svn_merge_range_dup(ret->merge_range, pool);
> + if (ret->url)
> + ret->url = apr_pstrdup(pool, ret->url);
> if (ret->path_prefix)
> ret->path_prefix = apr_pstrdup(pool, ret->path_prefix);
>
>
> Modified: trunk/subversion/svn/notify.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svn/notify.c?pathrev=35363&r1=35362&r2=35363
> ==============================================================================
> --- trunk/subversion/svn/notify.c Wed Jan 21 04:35:42 2009 (r35362)
> +++ trunk/subversion/svn/notify.c Wed Jan 21 06:03:13 2009 (r35363)
> @@ -119,9 +119,14 @@ notify(void *baton, const svn_wc_notify_
> {
> struct notify_baton *nb = baton;
> char statchar_buf[5] = " ";
> - const char *path_local = n->path;
> + const char *path_local;
> svn_error_t *err;
>
> + if (n->url)
> + path_local = url;
> + else
> + path_local = n->path;
> +
> if (n->path_prefix)
> {
> path_local = svn_path_is_child(n->path_prefix, path_local, pool);
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1041206

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041310
Received on 2009-01-21 16:22:45 CET

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.