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

Re: pre-commit hook for project version.

From: Jean-Marc van Leerdam <j.m.van.leerdam_at_gmail.com>
Date: Wed, 2 Apr 2008 10:01:51 +0200

Hi uprooter,

On 01/04/2008, uprooter <uprooter_at_gmail.com> wrote:
> Hi.
> I'm trying to implement an automated mechanism for creating a build version
> of a big project.
> The problem is that there are several kinds of IDE's involved so I want the
> server to do the version increment by modifying a dedicated file (lets say
> version.h) where I can keep the version number and auto increment it on
> every commit.

Do you want to have incremental build numbers (without gaps), or just
a reliable way of identifying the source code revision that was used
for the build?

If there is no requirement for consecutive numbers, you can use the
highest revision number in the working copy as a basis (svn up will
tell you this and there are other tools that can assist you with this:
SubWCRev on windows for example -- delivered with TSVN).

By starting your build with a step that retrieves the highest SVN
revision number and stores it in a (non-versioned) include file which
is used by the subsequent build steps you will get a build that can be
related back to the source version.

One thing to take notice of is that there could be local modifications
present in the workong copy that is being used to build the project.
svn status can show you this.

   // \\  @@     "De Chelonian Mobile"
  / \_/ \/._)    TortoiseSVN
 <\_/_\_/ /      The coolest Interface to (Sub)Version Control
  /_/   \_\      Check out http://tortoisesvn.net
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-04-02 10:02:12 CEST

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