You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Markus Fischer <ma...@fischer.name> on 2006/07/04 07:35:12 UTC

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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

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

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

Also, 'ls' doesn't work

svn: REPORT request failed on '/svn/repos/!svn/bc/38/proj/trunk/subdir'
svn: '/svn/repos/!svn/bc/38/proj/trunk/subdir' path not found

The URL from .svn/entries says

https://domain/svn/repos/proj/trunk/subdir

and when I run

svn ls
https://domain/svn/repos/proj/trunk/subdir

it works. So I'm a bit confused now as to where the error is. Is there
any additional debugging I can do?

thanks,
- - Markus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEqhow1nS0RcInK9ARAuNZAKDOh7ChdaN8lApL5ffZgHJdadW6kACgz7GK
ZszI4dH8lUZoQEMZi6rCS6c=
=7Bpg
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Markus Fischer <ma...@fischer.name>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Ryan Schmidt wrote:
> 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


I undo(ed?) my operation and in the new repos at https but prior to that
I made the paths be the same, so my starting point was

file:///repos/proj/subdir matched https://domain/svn/repos/proj/subdir

and ran

svn switch --relocate file:///repos https://domain/svn/repos

but from this point on my WC still gives me errors with my repos, e.g.
update gives

svn: REPORT request failed on '/svn/repos/!svn/vcc/default'
svn:
Cannot replace a directory from within

Maybe I have this problems because I'm doing this all in a subdirectory
of the checkout? I was doing this for safety reason, the project is so
big and before --relocate would change all URLs in all .svn/entries I
started with a simple directory which only has a few files in it.

So in reality I was operating from

proj_checkout/subdir

doing all the operations above.

I verified .svn/entries inside this directory all the time and the url
in <entry> was always pointing to a valid repos destination (be it
file:/// or https:/// ).

thanks,
- - Markus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEqkX01nS0RcInK9ARAq/CAKDLw5S/Bw8e1A2z5kM2YTNNyu/VYgCdFLag
hb5JDS2iTKuVw37a8qB/zxI=
=MQPp
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Ryan Schmidt <su...@ryandesign.com>.
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

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

Posted by Erik Huelsmann <eh...@gmail.com>.
On 7/4/06, Markus Fischer <ma...@fischer.name> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> Erik Huelsmann 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.
> >>
> >> So as can be seen, before it was proj/subdir in SVN and then I moved it
> >> to proj/trunk/subdir.
> >
> > well, the question is: what was your repository path (/svn/proj?) and
> > what is it now (https://domain/svn/proj?)?
>
> Yes, sorry I seem to mix up my own paths.
>
> Old repos: file:///svn/
> New repos: https://domain/svn/repos
>
> Thus:
> file:///svn/proj
> became
> https://domain/svn/repos/proj/trunk
> (I also created tags/branches/trunk in the new repos)
>
> >
> > You may have done more than just relocated, but I can't see that from
> > your report above. Could you tell us a bit more what you did when
> > relocating it?
>
> I dumped file:///svn and loaded it into the existing repository at
> https://domain/svn/repos, there it was accessible as
> https://domain/svn/repos/proj . Then I shove around and created
> directories so that the new path was https://domain/svn/repos/proj/trunk .
>
> >
> >>
> >> Then I used switch to switch my working copy to the new URL:
> >>
> >> svn switch --relocate file:///svn/proj https://domain/proj/trunk
> >
> > This is only correct if you moved your *repostory* from /svn/proj to
> > https://domain/svn/proj/trunk, which I somehow doubt.
>
> But that's exactly what I did, but I didn't just "moved" it but dumped
> and loaded it into the new place and then moved around directories.

Umm, no, not exactly: you 'moved' your repository from file:///svn/ to
https://domain/svn/repos/. So, you should relocate that way.

Then, you moved a repository path from <repos>/proj/ to
<repos>/proj/trunk. What happens is that the server sends a delete
command to the working copy for /proj/ and an add for /proj/trunk/.
But even before the /proj/ directory is deleted, the working copy
notices that it is currently rooted *within* /proj/, telling you it
can't delete itself. The easiest way to overcome that problem is to
use switch (without relocate) to switch from the current path to the
new trunk. But, then the paths must still be correct in 'svn info':
https:///domain/svn/repos/proj/ with the old revision number (38?).

HTH,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Markus Fischer <ma...@fischer.name>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Erik Huelsmann 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.
>>
>> So as can be seen, before it was proj/subdir in SVN and then I moved it
>> to proj/trunk/subdir.
> 
> well, the question is: what was your repository path (/svn/proj?) and
> what is it now (https://domain/svn/proj?)?

Yes, sorry I seem to mix up my own paths.

Old repos: file:///svn/
New repos: https://domain/svn/repos

Thus:
file:///svn/proj
became
https://domain/svn/repos/proj/trunk
(I also created tags/branches/trunk in the new repos)

> 
> You may have done more than just relocated, but I can't see that from
> your report above. Could you tell us a bit more what you did when
> relocating it?

I dumped file:///svn and loaded it into the existing repository at
https://domain/svn/repos, there it was accessible as
https://domain/svn/repos/proj . Then I shove around and created
directories so that the new path was https://domain/svn/repos/proj/trunk .

> 
>>
>> Then I used switch to switch my working copy to the new URL:
>>
>> svn switch --relocate file:///svn/proj https://domain/proj/trunk
> 
> This is only correct if you moved your *repostory* from /svn/proj to
> https://domain/svn/proj/trunk, which I somehow doubt.

But that's exactly what I did, but I didn't just "moved" it but dumped
and loaded it into the new place and then moved around directories.

thanks,
- - Markus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEqjLp1nS0RcInK9ARAmqXAJwNoZnqpR5r5zyMgGvbi1/N3gfZYwCeMRHL
AVVdcKBBWR0FvFqX1Z5KwTQ=
=P5cW
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Erik Huelsmann <eh...@gmail.com>.
On 7/4/06, Markus Fischer <ma...@fischer.name> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> I've a quite big checkout (~ 600MB) and moved the subversion repository
> from file:///svn/proj/subdir to https://domain/svn/proj/trunk/subdir.
>
> So as can be seen, before it was proj/subdir in SVN and then I moved it
> to proj/trunk/subdir.

well, the question is: what was your repository path (/svn/proj?) and
what is it now (https://domain/svn/proj?)?

You may have done more than just relocated, but I can't see that from
your report above. Could you tell us a bit more what you did when
relocating it?

>
> Then I used switch to switch my working copy to the new URL:
>
> svn switch --relocate file:///svn/proj https://domain/proj/trunk

This is only correct if you moved your *repostory* from /svn/proj to
https://domain/svn/proj/trunk, which I somehow doubt.

The rest of your questions need more info to be answered...

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org