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

Re: svn commit: r1326696 - in /subversion/trunk/subversion/libsvn_client: add.c client.h commit.c copy.c delete.c prop_commands.c util.c

From: Stefan Sperling <stsp_at_elego.de>
Date: Tue, 17 Apr 2012 00:04:36 +0200

On Mon, Apr 16, 2012 at 04:41:49PM -0500, Hyrum K Wright wrote:
> On Mon, Apr 16, 2012 at 4:35 PM, Greg Stein <gstein_at_gmail.com> wrote:
> > On Mon, Apr 16, 2012 at 13:50,  <hwright_at_apache.org> wrote:
> >>...
> >> +++ subversion/trunk/subversion/libsvn_client/util.c Mon Apr 16 17:50:05 2012
> >>...
> >> +  /* ### We could probably calculate some of this once, and then cache it for
> >> +         use in this function. */
> >> +  SVN_ERR(svn_wc__get_wc_root(&wcroot_abspath, scb->wc_ctx,
> >> +                              scb->anchor_abspath,
> >> +                              scratch_pool, scratch_pool));
> >> +  SVN_ERR(svn_wc__node_get_url(&wcroot_url, scb->wc_ctx, wcroot_abspath,
> >> +                               scratch_pool, scratch_pool));
> >> +
> >> +  relpath = svn_uri_skip_ancestor(wcroot_url, node_url, scratch_pool);
> >> +  *local_abspath = svn_dirent_join(wcroot_abspath, relpath, result_pool);
> >
> > Won't this join() fail in a switched working copy?
>
> Honestly, I haven't thought much about it. Any proposals on how to
> work around it?

At the very least, you must compare the URL of the node at the calculated
local_abspath to the original node_url. If they do not match, the
node at local_abspath is switched, so the node you're looking for is not
in the WC at the expected location.

The node could be somewhere else, though, at a different path which
is switched to the original URL you're looking for. Maybe you'll need
to add a new libsvn_wc API that tries a bit harder to figure out where
the node could be?
Received on 2012-04-17 00:05:17 CEST

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.