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

Re: How to insert global (not last changed) revision number into code?

From: Max Bowsher <maxb_at_ukf.net>
Date: 2004-07-02 18:45:22 CEST

Sean Spicer wrote:
> Okay, I've got another good question (I think):
>
> I'd like to insert the last checked-out revision number (that returned
> by svn status -u) as a string into a piece of code. So what I'd like
> to do is have
>
> // version.h
>
> const string REVISION_NUMBER = "$GlobalRev$"
> const string REVISION_LOCAL="$GlobalLocal$"
>
> Where global rev get's expanded to the latest global revision number
> when I checkout the code. Also the local is important (whether I'm on
> a trunk or a branch). So the expanded file might look like:
>
> // version.h
>
> const string REVISION_NUMBER="12452"
> const string
> REVISION_LOCAL="/home/sspicer/Project/branches/wxWindows_port
>
> Any ideas on what would be the best way to do this ?

Read about "svnversion" in the book.

Max.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jul 2 18:50:18 2004

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