Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN Switch Relocate - is not the root of the repository

Tags:

I'm trying to move a working copy folder from it's old dedicated svn server, to a new svn server where it is contained within a sub-folder. Using the following relocate command:

svn switch --relocate https://oldserver/svn/repos https://newserver/some/directory 

I get:

svn: 'https://newserver/some/directory ' is not the root of the repository

Which is correct ..... but, err, how do I move the location regardless?

like image 825
Jon Hadley Avatar asked Jan 28 '10 14:01

Jon Hadley


People also ask

What does svn relocate do?

The --relocate option causes svn switch to do something different: it updates your working copy to point to the same repository directory, only at a different URL (typically because an administrator has moved the repository to another server, or to another URL on the same server).

How do I move my TortoiseSVN repository?

If you are using TortoiseSVN (and I'm sure there's a command line tool for this as well, but I'm using Tortoise), you can simply right-click on your existing working copy folder and select TortoiseSVN –> Relocate. In the dialog that comes up, enter the new location of the repository, and click OK.

How do I move a directory in svn repository?

Moving files and folders select the files or directories you want to move. right drag them to the new location inside the working copy. release the right mouse button. in the popup menu select Context Menu → SVN Move versioned files here.

What is switch in TortoiseSVN?

Switch your current working copy to the newly created copy in the repository. Again select the top level folder of your project and use TortoiseSVN → Switch... from the context menu. In the next dialog enter the URL of the branch you just created. Select the Head Revision radio button and click on OK.


2 Answers

As far as I understand, you can't use svn switch (with or without --relocate) to move to a new repository. Think about it this way: your new repository's HEAD revision is x, your old repository's revision is y, so what is SVN supposed to do with the working copy's base revision?

svn help switch says that --relocate is used to:

Rewrite working copy URL metadata to reflect a syntactic change only. This is used when repository's root URL changes (such as a scheme or hostname change) but your working copy still reflects the same directory within the same repository.

Since this is not the case, I'm afraid you'll have to perform a fresh checkout.

like image 148
Eli Acherkan Avatar answered Sep 19 '22 10:09

Eli Acherkan


I tried the same operation, in this case I had a copy using svnsync in a file: url and moved it using mv /home/me/sync/therepo /home/me/sync/repos/therepo.

The reason: I have several help scripts in the sync catalog that mess up the view of the repos.

svn switch --relocate worked for the most part, except externals that keep complaining.

The solution was brutal: I deleted (rm -rf) the directories with the offending files in them and ran svn update again to refetch the externals.

At least this way I did not have to do the large checkout again.

Also, now I can write instructions for my coworkers when we move the svn server to a new machine later on.

like image 35
Torbjörn Axelsson Avatar answered Sep 21 '22 10:09

Torbjörn Axelsson