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

Re: svn commit: r1389851 - /subversion/trunk/subversion/libsvn_client/commit.c

From: Stefan Sperling <stsp_at_elego.de>
Date: Tue, 2 Oct 2012 13:30:48 +0200

On Tue, Oct 02, 2012 at 11:56:22AM +0100, Philip Martin wrote:
> stsp_at_apache.org writes:
>
> > Author: stsp
> > Date: Tue Sep 25 13:10:00 2012
> > New Revision: 1389851
> >
> > URL: http://svn.apache.org/viewvc?rev=1389851&view=rev
> > Log:
> > Fix commit from multiple working copies which are nested within an unrelated
> > working copy.
> >
> > This patch fixes commit_test 26 on the 1.7.x branch when run within
> > a format 30 working copy (backport nomination will follow).
>
> > + /* When committing from multiple WCs, get the RA editor from
> > + * the first WC, rather than the BASE_ABSPATH. The BASE_ABSPATH
> > + * might be an unrelated parent of nested working copies.
> > + * We don't support commits to multiple repositories so using
> > + * the first WC to get the RA session is safe. */
> > + if (lock_targets->nelts > 1)
> > + ra_session_wc = APR_ARRAY_IDX(lock_targets, 0, const char *);
> > + else
> > + ra_session_wc = base_abspath;
> > +
>
> Is that more complicated than necessary? I think we can use
> APR_ARRAY_IDX(lock_targets, 0, const char *) all the time.

It was using base_abspath before my change, and I kept the existing
code path as it was. But thinking about it, yes, if there's only
one target it will be in lock_targets[0].

I suppose we can tweak this on trunk but leave 1.7 as it is.
It's not very elegant but it isn't wrong.
Received on 2012-10-02 13:31:27 CEST

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