Tuesday, September 9, 2008

How to change/update the URL of your SVN repository

Sourceforge has done some huge updates and changes during the last couple of months, and I might not be the busiest bee regarding updates and commits to my own project, Subspace Battle.

Today when I was doing some updates and fixes, I tried to call it a night and did the final touch: a commit. But for some reason I kept getting a '403' error, which means there is some security issue. I knew my password was correct, and also the user, so what could it be? Perhaps the UUID of the server had changed after sourceforge's updates, and that somehow stopped the update. I checked their website to see if there were any changes or big "REMEMBER TO DO THIS" signs waving at me, but saw none.

After reading through parts of the svn guide, I compared my repository URL to the one I got from the 'svn info' command. It turns out that they have switched to https (instead of http), which means my URL was wrong. So how do we update it without downloading another local copy of everything? I tried several different solutions, and finally find the right one!
svn switch --relocate http://subspacebattle.svn.sourceforge.net/svnroot/subspacebattle https://subspacebattle.svn.sourceforge.net/svnroot/subspacebattle
This simply changes the URL of the repository that your local version maps to. Or as the 'help' chapter describes it, if only I had read that sooner...
switch (sw): Update the working copy to a different URL.
usage: switch --relocate FROM TO [PATH...]

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.
Now let's get on with the commits!

3 comments:

Anonymous said...

Thanks! Your solution helped me.

Anonymous said...

It's works :). Thank You

Absolut said...

Nice blogpost, opeth fan

what's the watch on your profile photo on this blog? Swatch or Vx.?