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

Re: snv:keywords - want current checked out working revision ID

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2004-05-07 18:10:24 CEST

Please oh please, will somebody write a FAQ for this question? It seems
to come up all the time.

On Fri, 2004-05-07 at 07:33, Scott Lawrence wrote:
> On Fri, 2004-05-07 at 06:09, Adrian Oliver wrote:
> > I want to be able to put into my code the currently checked out working
> > revision ID using a keyword.
> >
> > For example, when I perform an svn update, svn checkout or svn commit,
> > the last thing it displays is: "Updated to revision 140."
> >
> > I would like to put into my code the "140" using a keyword, as it
> > provides a means of linking a compiled executable with the svn revision
> > used to generate it.
> >
> > I accept that if changes are made after the update, checkout or commit
> > and are not recommitted, that it would not be telling the whole truth.
>
> In your Makefile, link svn_version.o into your executable, then add:
>
> svn_version.c: FORCE
> echo 'const char* svn_version(void) { return "' > svn_version.c
> svnversion -n . >> svn_version.c
> echo '"; }' >> svn_version.c
>
> a call to svn_version() will return the working copy version string.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat May 8 00:55:10 2004

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.