tags:

views:

182

answers:

3

I couldn't figure out how to do a repository url redirect in Svn...

Here is a scenario:

For SVN server we use Visual SVN, for clients mostly Tortoise SVN.

We create a branch each time we do a production source rollover. Then the url looks like this:

http://svnserver.blabla.com/branches/8%5F3%5F0%5F0/development ... next time will be http://svnserver.blabla.com/branches/8%5F4%5F0%5F0/development etc.

Now I want to have one URL like this : http://svnserver.blabla.com/production/ ... to be pointing to http://svnserver.blabla.com/branches/8%5F3%5F0%5F0/

So any time you want to checkout or to go to production source we will use one URL.

Can this be done and how?

Thanks.

A: 

Ive neer used VisualSVN but assuming it has all the features of Subversion the easiest way is to set production as an svn:external to your branch. Then everytime you roll over youd need to edit this property to point to the proper branch.

prodigitalson
hm, I don't understand what I want is when developer wants to do a production code fix he should just go and use that short single url http://svnserver.blabla.com/production instead of real branch url which changes all the time.
Irfan Mulic
right svn:externals is like aliasing or making a short cut to where ever you point it. So long as the user has the right credentials on the actual branch to commit he can do it with the external checkout. you just change the external definition to a different branch when you need to and everything else should be good to go.
prodigitalson
+1  A: 

If you use apache as a front end of the svn server, you could try to redirect the url in the apache config (httpd.conf). Ie:

RewriteRule "http://svnserver.blabla.com/branches/prod" "http://svnserver.blabla.com/branches/release_74" [P]

Some useful links: http://serverfault.com/questions/79938/how-can-i-configure-apache-to-redirect-a-subdirectory-to-a-subversion-repo http://silmor.de/49

I hope it helps you

Aito
+2  A: 

Create a branch called /production, and merge or copy each production release’s changes to it. This will accomplish your goal of always having the production code accessible at the same URL, and SVN’s merge/copy tracking will record which branch generated which revision of /production.

Michael Hackner
This is exactly what is the easiest way to do. We have tags that hold a specific version but the production branch will be always the /production. Thanks Michael.
Irfan Mulic