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

Re: svn:keywords?

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-03-19 19:53:00 CET

Hier, Steve wrote:

> Has anyone created a keyword that expands to be the CURRENT revision of
> the tree within a file, regardless of changes to that file?

Keywords are not programmable (at this time), however, I think this could be
helpful:

> usage: svnversion [options] wc_path [trail_url]
>
> Produce a compact "version number" for the working copy path
> WC_PATH. TRAIL_URL is the trailing portion of the URL used to
> determine if WC_PATH itself is switched (detection of switches
> within WC_PATH does not rely on TRAIL_URL). The version number
> is written to standard output. For example:
>
> $ svnversion . /repos/svn/trunk
> 4168

Add to your distribution process something like this:

        echo -n "#define CURRENT_REV " > current_rev.h
        svnversion . >> current_rev.h

and then you can use CURRENT_REV anywhere you want in your code. One thing to
note is that the repository revision is a particularly lousy way to track a
project version (unless you have only a single project in your repository).

HTH

John

-- 
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: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 19 19:52:56 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.