http://qs321.pair.com?node_id=668745


in reply to Automatic $VERSION updates and subversion tips?

As long as your source code is kept in a single tree, Subversion's $Revision$ works perfectly well. The only thing you need to do differently than in CVS is that revision numbers are integers. So you get something like this (untested) code:
# Subversion example ($VERSION) = (q$Revision: 123 $ =~ /(\d+)/);
For the record, that is what I do at $work.

As noted in the link you were dealing with, if you're using a distributed source control system, then you run into problems with different people having different versions. The cheap solution to that is to define one version as canonical, and have that version use revision control to produce version numbers. So you can have a script which runs on that system that, after you take patches, uses its revision number to set the appropriate $VERSION and then produces a patch for everyone else. As long as only one machine generates $VERSION patches, you shouldn't have too many annoying conflicts to resolve.

Replies are listed 'Best First'.
Re^2: Automatic $VERSION updates and subversion tips?
by bsb (Priest) on Feb 20, 2008 at 00:32 UTC
    I usually develop with svk connected to an svn mirror and deploy from an svn build environment, so I can probably just use the svn revision number as the master version. I may occasionally need to use svn to checkout a specific version, but that's a rare occurrence.

    Thanks