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

Re: Confusing error: "Cannot replace a directory from within"

From: Peter Lundblad <plundblad_at_google.com>
Date: 2007-05-10 05:25:01 CEST

David Glasser writes:
> + /* Check to make sure that the switch target actually exists. */
> + SVN_ERR(svn_ra_reparent(ra_session, source_root, pool));
> + SVN_ERR(svn_ra_check_path(ra_session,
> + svn_path_is_child(source_root, switch_url, pool),
> + revnum,
> + &switch_url_kind,
> + pool));
> +
> + if (switch_url_kind == svn_node_none)
> + return svn_error_createf
> + (SVN_ERR_WC_INVALID_SWITCH, NULL,
> + _("No such path '%s'"), switch_url);
> +
> + SVN_ERR(svn_ra_reparent(ra_session, URL, pool));
> +
> +

For svnserve, this adds three extra roundtrips just for the sanity check
(not saying it is the wrong tradeoof if there's no other way) and
reconnects twice if you're working against anolder server.
Is there a cheaper way to do it? Is it possible to check for a specific
error returned from the server?
(I don't have the sources handy ATM, so that might be a too easy question
to anser...)

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu May 10 05:25:51 2007

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.