views:

45

answers:

3

Let's say I have a "releases" subdirectory in my svn repository, where I have multiple releases of the project. I would like to have a "latestRelease" alias, which would point to whatever the current release is. Is there any way to do this, without actually copying the latest release branch?

I am not talking about checking symbolic links into svn. Essentially, I am talking about creating symbolic links inside the repository.

+2  A: 

You can use a svn:externals for this.

khmarbaise
I think this is it.
Dima
+2  A: 

We use tags for this; just update the tag when you do a new release.

svn:externals are another possibility, though those are usually used to reference external sources (like libraries you're using), they will work though I think you'll have to use the peg revision to pick a particular revision you want to reference.

You could also make 'lastestRelease' branch and then merge everything over to it whenever you do a release.

3 ways to do what you want - choosing one is up to you :)

pjz
clarify the "just update the tag" part. "tags" in svn (in practice) are meant to be read-only and most folks use pre-commit hooks to enforce it since svn itself doesn't intrinsically support the notion of a tag
whaley
+3  A: 

You can commit symbolic links just fine in SVN. The problem here however is that they won't work on Windows (obviously). The SVN repository itself doesn't store symlinks but rather stores the symlink as a versioned file whose contents point to the path the symlink was made to and also uses the svn:special property to let svn clients they may need to something special with it (e.g. convert it back to a symlink).

This link from collabnet has a small bit more detail: http://help.collab.net/index.jsp?topic=/faq/symlinks.html

Additionally, in your /releases directory in svn, you should consider making your "tags" of your releases based on the version number of your application such that finding the latest is as trivial as comparing numbers.

And on an somewhat related note: unless you are already using a /tags directory for user tags and reserving /releases for tags related to releases, I'd recommend to stick to convention and use a top level /tags directory for what you are talking about.

whaley
That's the thing. I am not talking about checking symlinks in. I am talking about symlinks in the repository itself, i. e. making a link from one part of the repository to another.
Dima