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

Re: repository revision -> header file?

From: Konrad Rosenbaum <konrad_at_silmor.de>
Date: 2006-05-12 08:31:07 CEST

On Friday 12 May 2006 00:57, Ralf W. Grosse-Kunstleve wrote:
> I see SVN maintains a global revision number for a repository. I'd
> like to access this revision number via a C or C++ header file, e.g.
>
> myproj/version.h:
>
> #define MYPROJ_REPOSITORY_REVISION $RepositoryRevision$
>
> I.e. each time svn update is run, I'd like to get the same number
> that is printed at the end ("Updated to revision 4548."):
>
> #define MYPROJ_REPOSITORY_REVISION 4548

I usually do things like this by creating the header file within the
Makefile or a script. SVN-Keywords work on the file only anyway.

You can get information about the revision in the local working copy with
"svn info", the remainder is a question of grep, cut and a bit of
scripting.

        Konrad

  • application/pgp-signature attachment: stored
Received on Fri May 12 08:32:24 2006

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.