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

Re: Newbie question: getting the revision number substituted in the source code

From: Alexis Huxley <ahuxley_at_gmx.net>
Date: 2003-01-08 20:07:55 CET

> > svn print "Version %t.%r, built %D %T"
> Version 1.2.2311, built 2003-01-08 19:32:00

I produce this from the program's I've written by getting the code
to disect the 'HeadURL' string. So far only with shell and perl,
I have

        SVN_ID='$HeadURL$ $LastChangedRevision$'

and the URL is something like:

        http://google.stop.trawling.com/svn/<prog>/trunk/main.sh

or:

        http://google.stop.trawling.com/svn/<prog>/tags/0.1/main.sh

It's then trivial to get it to work out of it is tagged or not. If
it is it reports "release 0.1" otherwise it reports "revision <whatever>".

Somebody suggested this approach on the list a few months ago, and
I use it; it works fine.

Karl's reports the *head*, which is probably not what you want: don't
you just want the highest of all the last changed revisions in
the sources?

For a development version I don't know a solution, but for a released
version - which you tag - then they all get stamped with the same
revision, so then it works fine.

Alexis

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jan 8 20:08:45 2003

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