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

Re: svn:keywords last changed checked out directory revision number

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-03-30 19:03:08 CEST

Adam Gibson wrote:

> How do most people deal with including a revision number in their apps?

For a Unix-like OS, the following will do what you might want:

        $ echo -n "#define REVISION " > rev.h
        $ svnversion . >> rev.h

NOTE: you should do `svn up' prior to this, or you might get a mixed revision
answer (like 230:231 where the WC was just committed but not yet updated ).

I say "might want" above because the revision number is not necessarily the
correct thing to use in all cases. If you have a single project repository, the
revision number will always reflect changes to that project (conceivably on a
branch as well as on the trunk). However, if you have multiple projects in the
same repository, the revision number will increase in relation to work on all
projects, so you could conceivably have huge jumps in revision number for a
project which changes little.

If that is OK for your purposes, then you can use something like the above in
your Makefile to regenerate the rev.h file for every release.



John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Mar 30 19:03:50 2004

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