Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to switch to a new SVN repository.

I currently have the following checkout:

$ svn info
svn+ssh://some.server.edu/home/name/svn-repositories/proj/trunk

Now I wanted to switch, but I get an error:

$ svn switch --relocate \
  svn+ssh://some.server.edu/home/name/svn-repositories/proj/trunk \
  https://subversion.assembla.com/svn/name/trunk/proj .
svn: The repository at 'https://subversion.assembla.com/svn/name/trunk/proj' 
has uuid '...', but the WC has '...'

I thought the whole point of svn switch --relocate was that there are two repositories with different uuids? How can I correctly switch to the new repos?

BTW, the directories should be correct: The old proj/trunk and the new trunk/proj contain exactly the same files etc.:

$ svn ls https://subversion.assembla.com/svn/<name>/trunk/proj
foo.txt
$ svn ls svn+ssh://some.server.edu/home/name/svn-repositories/proj/trunk
foo.txt

I am using svn 1.6.5 on the Mac.

share|improve this question

2 Answers 2

svn switch --relocate expects to find the same repository at a new URL, not a different one.

Did you use svnsync to create the new repository? In that case you can use svnadmin setuuid to use the same uuid as the old repository. According to the svnsync documentation in the svn book, this should enable you to reuse existing working copies.

share|improve this answer
    
I did this with a svnsync to move a repo to a new location. svnadmin setuuid save the day! –  Matt Connolly May 10 '11 at 4:39

The --relocate flag updates your working copy if the URL used to reach your existing repository changes. There's not a good way for SVN to switch a working copy to a new repository, because even though it might contain the same files, any number of other things might be different -- the history, the number of checkins, the contents of the files, et cetera, and SVN isn't designed to account for those sorts of differences.

You've asked your question purely from the client perspective, but it would be useful to have a bigger picture of what you're trying to do. For instance, are you trying to move your own repository to a new server? If so, what method did you use, and might there be a better one? Or have you been using a repository managed by someone else and they moved it? Is all of the history of the old repository present in the new repository? Is there a reason you/they can't copy the SVN database files to the new server instead of creating a brand new repository?

There is a way to force what you want -- namely, delete your .svn directories from your working copy (make a backup first!), check out a new copy from the new server, and move all of the .svn directories from the new copy to the corresponding places in your working copy. But only do that once you've considered the bigger picture.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.