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

Re: svn commit: r39598 - in trunk/subversion: include libsvn_wc

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 19 Oct 2009 17:40:11 +0100

On Fri, 2009-09-25, Bert Huijben wrote:
> Author: rhuijben
> Date: Fri Sep 25 06:14:56 2009
> New Revision: 39598
>
> Log:
> Add some Request-For-Comment (RFC) version of the new working copy conflict
> api, to allow in-file commenting and sharing the load of updating :)

Problem below...

> Copied and modified: trunk/subversion/libsvn_wc/conflicts.c (from r39596, trunk/subversion/libsvn_wc/adm_ops.c)
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/conflicts.c?pathrev=39598&r1=39596&r2=39598
> ==============================================================================
> --- trunk/subversion/libsvn_wc/adm_ops.c Fri Sep 25 02:44:57 2009 (r39596, copy source)
> +++ trunk/subversion/libsvn_wc/conflicts.c Fri Sep 25 06:14:56 2009 (r39598)
> @@ -1,10 +1,7 @@
> /*
> + * conflicts.c: routines for managing conflict data.
> + * NOTE: this code doesn't know where the conflict is
> + * actually stored.
> *
> * ====================================================================
> * Licensed to the Subversion Corporation (SVN Corp.) under one

> +struct svn_wc_conflict_t
> +{
> + /* Pool conflict is allocated in */
> + apr_pool_t *pool;
>
> + /* ### kind + property name are the primary keys of a conflict */
> + /* The kind of conflict recorded */
> + svn_wc_conflict_kind_t kind;
> +
> + /* When describing a property conflict the property name
> + or "" when no property name is available. (Upgrade from old WC or
> + raised via compatibility apis). */
> + const char *property_name;

> + /* ### TODO: Add more fields */
> +};
 
> +svn_error_t *
> +svn_wc_conflict_dup(svn_wc_conflict_t** duplicate,
> + svn_wc_conflict_t* base,
> + apr_pool_t *result_pool)
> {
> + svn_wc_conflict_t *c;
> + if (result_pool == base->pool)
> {
> + /* No need to duplicate; base has the same liftime and its inner
> + values can't change */

... This is trying to be too clever. The doc string promises to return a
copy of the structure, allocated in result_pool. If it's important to
implement such an optimisation (and I don't know that it is) the
doc-string should allow it.

> + *duplicate = base;
> + return SVN_NO_ERROR;
> }
> +
> + SVN_ERR(conflict_alloc(&c, result_pool));
>
> + c->kind = base->kind;
> + c->property_name = base->property_name
> + ? apr_pstrdup(result_pool, base->property_name)
> + : NULL;
>
> + *duplicate = c;
> return SVN_NO_ERROR;
> }

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2409027
Received on 2009-10-19 18:40:34 CEST

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