[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Any simple way to set/get global revision number?

From: Bob Archer <bob.archer_at_amsi.com>
Date: Wed, 9 Dec 2009 11:33:55 -0500

> > How about taking a slightly different approach.
> >
> > Rather than versioning your app based on the svn revision number,
> > version it based on the build number. Have the build script
> update the
> > version.h file. Once the build is done commit the version.h file
> and
> > create a tag for that build. Now if someone updates from head and
> does
> > a manual build the version.h file is correct for that revision.
> >
> > BOb
> >
> >
> Yes, I failed to mention that is similar to the first approach I
> implemented - people use mix of linux and windows tortoise client
> and they instinctively just commit specific files they changed (me
> included) and the elegant self generating version .h file (that I
> spent time getting just right with lots of echo's and >> and a note
> about this being an automatically generated file, do not edit, etc
> :-) sits as an orphan in their directory forever or until they
> remember to check it in. Next person does update and the version
> number is unchanged.
>
> Of course having the build script doing an auto-commit on file
> changes isn't practical since people do tons of builds a day. Looks
> like creating a special build process using auto tools or scripts
> and svnversion seems only solution and if you don't have this with
> full svn and gnu in your environment you are out of luck and have
> to rely on manually versioning those files before distributing
> them.

If the build script is run by a dev it should not be committed as an official version. Only the build server can commit an official version. This is easy to do by having a property in your build script that flags whether this is a versioned build or just an interim build that a dev is testing.

You could also have a "current" tag that is updated after each build so people that are building for production would checkout/export from that tag which would always have the correct version.h in it.

BOb

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2428905

Please start new threads on the <users_at_subversion.apache.org> mailing list.
To subscribe to the new list, send an empty e-mail to <users-subscribe_at_subversion.apache.org>.
Received on 2009-12-09 17:35:29 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.