[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: David Glasser <glasser_at_mit.edu>
Date: 2007-05-10 05:01:56 CEST

On 5/9/07, Karl Fogel <kfogel@red-bean.com> wrote:
> > + /* Disallow a switch operation to change the repository root of the
> > target. */
> > + if (! svn_path_is_ancestor(source_root, switch_url))
> > + return svn_error_createf
> > + _("'%s'\n"
> > + "is not the same repository as\n"
> > + "'%s'"), switch_url, source_root);
> [Odd line-wrapping from your mailer there, but no big deal.]
> So, just to make sure I understand correctly: here you're introducing
> a sanity check (make sure they're the same repository) that's not
> really related to the bug reported, right? Not objecting, just making
> sure I understand -- and the log message might want to mention it.
> When someone wants to switch from, say, "svn+ssh://" to "svn://",
> should they use 'switch --relocate'? If not, and the recommended way
> is plain 'svn switch', then I think this check would block them...

Good point, I'll mention that in the log message. In fact, this block
is borrowed from the creation of the switch editor in
libsvn_wc/update_editor.c(make_editor); so adding this check here only
catches the issue earlier. (It still should be checked in libsvn_wc
as well, of course.)

> Well, we know it's a switch, so how about
> return svn_error_createf
> _("Destination does not exist: '%s'"), switch_url);

Sounds good.

> Fast work!

I only have two class assignments left as a student ever. It's my
last chance to procrastinate homework. Quite an incentive :)


David Glasser | glasser_at_mit.edu | http://www.davidglasser.net/
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:02:09 2007

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