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

RE: Head revision number auto update in code files

From: Bob Archer <Bob.Archer_at_amsi.com>
Date: Wed, 14 Aug 2013 15:20:39 +0000

> I want to implement the head revision number in my C project at the file
> version.h.
> Unfortunately there is only the codeword $Revision$ to set the last revision
> where the file version.h was changed:
> #define VERSION      " FW.Vers. 0.0 $Revision: 146 $\n"
>
> Is it possible to implement the Keyword $Head$ to always (every commit)
> update the string to the head revision number?
> e.G.:
> #define VERSION      " FW.Vers. 0.0 $Head: 153 $\n"
>
> The problem was detected e.G. here:
> http://hobiger.org/blog/2013/04/18/svn-revision-number-in-c-code-an-
> impossible-task/
>
> See SVN Manual (V1.8): 4.17.1.1. svn:keywords
>
> Best regards

I'm pretty sure keyword expansion is done on checkout/update not on commit. So, no, I doubt this would be possible. Generally you should have your build scripts set the version in your header file to match the HEAD revision.

BOb

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3062623

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2013-08-14 17:21:08 CEST

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

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