开发者

SVN Switch Relocate - is not the root of the repository

开发者 https://www.devze.com 2022-12-18 22:15 出处:网络
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:

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?


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.


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.


What can happen too is that you are doing the relocate on a child of the root.

Try to do a relocate on the root folder. All the children folders will be automatically relocated too.


Well im assuming youve already actually migrated the repository via svnadmin dump/svnadmin load so in that case you could try: svn switch --relocate https://newserver/some/directory If you get the same error you might actually have to just do a new svn co. I dont recall ever coming across that error but then all my repos use a nested structure like the one youre moving to so its possible ive never had to deal with it :-)

0

精彩评论

暂无评论...
验证码 换一张
取 消