1

I have multiple branches in SVN, with releases in it:

/branches/releaseApril
/branches/releaseMay
/branches/releaseJune

I want to mark the release currently in production as a branch:

/branches/production

If somebody commits something to /branches/production, I want the underlying branch to change. Like a symlink in SVN. Is this possible?

Sjoerd
  • 74,049
  • 16
  • 131
  • 175
  • possible duplicate of [Creating symbolic links to branches in SVN?](http://stackoverflow.com/questions/1143853/creating-symbolic-links-to-branches-in-svn) – Sjoerd Jun 24 '11 at 08:53
  • It seems to be impossible to create a link from one branch to another. Externals only work on subdirectories of something you checked out. – Sjoerd Jul 07 '11 at 11:11

4 Answers4

1

You can accomplish something similar to this with externals. But there are drawbacks.

Community
  • 1
  • 1
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
  • I can't get this to work. It seems an svn:externals for /branches/production is only used when you check out /branches, not /branches/production. – Sjoerd Jun 24 '11 at 08:50
1

You can set an external to ^/branches/releaseJune at production on branches, but that external will be seen when you checkout branches. There is no way to checkout /branches/production and start using it.

What you can do is have a production branch under branches ( basically a production folder under branches ) and define an external for it pointing to /branches/releaseJune etc. and using a folder like current. So when people checkout /branches/production they get a folder current which is /branches/releaseJune

Also, make sure you update the external when you do a new release to point it to the correct branch.

manojlds
  • 290,304
  • 63
  • 469
  • 417
0

No, this is not possible. You can remove a branch and make a new branch with the same name, but it is not possible to update the "pointer" of a branch to make it point somewhere else.

Sjoerd
  • 74,049
  • 16
  • 131
  • 175
0

Try svn:external. It might feel odd to use that but it should do what you want.

Another option is to make the branch /branches/production read only for everyone. That way, no one can accidentally change it but it means people have to switch to the right branch (and they might use the wrong one, so you're back at square one).

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820