Subversion - put the version number in the file

I only need one file called โ€œrevisionโ€, which contains the version number of the repository at any given time, so when I export my repository, my application can see which version.

How can i do this?

+6
svn deployment revision
source share
3 answers

The problem with using regular keyword substitution is that $rev$ only shows the latest version in which this file was modified. I have not tried it myself, but there is a tool called svnversion that comes with SVN, which I believe can be used to get the working copy version number. Then you just need to configure the build process to use this tool and paste the result into the patch file.

There is a good guide on using svnversion (especially if you use ANT) here: http://cameronstokes.com/2009/12/12/using-svnversion-from-ant

+3
source share

I guess you could do something using the pre-commit hook, but I really don't know if this was a great idea.

Why don't you use your app yourself? (and, for example, put the version number in the commit comment) Wouldn't that be a simpler solution?

The more svn version numbers are set one at a time no matter which branch it is attached to, is this normal for you?

0
source share
0
source share

All Articles