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

Re: Can't get switch --relocate to work, always "Cannot replace a directory from within"

From: Ryan Schmidt <subversion-2006c_at_ryandesign.com>
Date: 2006-07-04 11:32:12 CEST

On Jul 4, 2006, at 09:35, Markus Fischer wrote:

> I've a quite big checkout (~ 600MB) and moved the subversion
> repository
> from file:///svn/proj/subdir to https://domain/svn/proj/trunk/subdir.

I don't think you did. Which part of both of those paths is the root
of the repository, the thing that was originally "svnadmin create"d?
I'm assuming that's either "file:///svn" / "https://domain/svn" or
"file:///svn/proj" / "https://domain/svn/proj".

> So as can be seen, before it was proj/subdir in SVN and then I
> moved it
> to proj/trunk/subdir.
>
> Then I used switch to switch my working copy to the new URL:
>
> svn switch --relocate file:///svn/proj https://domain/proj/trunk
>
> The operation doesn't indicate a failure (probably it doesn't contact
> any repos), but when I run 'update' I get:
>
> svn: REPORT request failed on '/svn/repos/!svn/vcc/default'
> svn:
> Cannot replace a directory from within

Hold up. There's "svn switch" and there's "svn switch --relocate".
They are two entirely unrelated commands, used for different
purposes; it's unfortunate that they're both accessed with "svn
switch" but that's how it is for now.

"svn switch" means "I have a working copy of part of a repository,
say the trunk, and now I want to change my working copy so it's
pointing at a branch of the same repository." Or: "I have a working
copy of, for example, the trunk, and now someone has gone and "svn
mv"ed the trunk somewhere else within that repository, and I want my
working copy to still point to it at its new location." "svn switch"
takes a another URL of the same repository as an argument, and
contacts the repository and gets all the data needed to make the
switch to that location happen.

"svn switch --relocate" does something entirely different. It means
"I have a working copy of part of a repository, and the whole
repository has been moved to a different URL (by means of changed
Apache configuration, for example), or even to a different protocol
as in your case, but is otherwise identical, and I want my working
copy to still point at it." "svn switch --relocate" takes two
arguments as parameters: the part of the URL in the working copy that
you want to replace (starting at the beginning), and what you want to
replace it with. It does not contact the repository at all; it just
does string replacements within the .svn directories of your working
copy.

It sounds like you're trying to combine an "svn switch" and an "svn
switch --relocate" in a single operation, which I don't think you can
do.

Since you've done an incorrect "svn switch --relocate", we should
first undo that:

# Undo first relocate
svn switch --relocate https://domain/proj/trunk file:///svn/proj

Now, I would do this:

# Relocate the working copy to point at https://domain instead of
file:///svn
svn switch --relocate file:///svn https://domain

# Now switch to the new location of proj/subdir
svn switch https://domain/svn/proj/trunk/subdir

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jul 4 11:34:00 2006

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