Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Automatic $VERSION updates and subversion tips?

by tilly (Archbishop)
on Feb 19, 2008 at 07:20 UTC ( #668745=note: print w/replies, xml ) Need Help??

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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://668745]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2020-10-31 22:34 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (291 votes). Check out past polls.