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

Re: versioning rant

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-02-21 01:01:53 CET

On Wed, Feb 20, 2002 at 06:49:39PM -0500, Garrett Rooney wrote:
> On Wed, Feb 20, 2002 at 06:27:58PM -0500, Perry E. Metzger wrote:
> > Speaking from NetBSD (and I'm concerned about making sure NetBSD can
> > use Subversion), we need to be able to identify the revisions of the
> > files that built an executable. That also implies, by the way, that we
> > need to know which branch and revision the version comes from since
> > subversion has only the one revision for the entire repository, thus
> > Wednesdays 1.5 branch and trunk would have the same revision number.

I presume that NetBSD uses CVS keywords in every file for this

> > When I say "need", I mean "need". I have to be able to figure out what
> > someone is running.

Quite reasonable.

I was just referring to the version number that somebody reports when they
do "svn --version". There is no *single* number that can be reported there,
in a safe manner (unless you build and distribute a binary, in which case
you know what went into the thing). Building from a distro is usually quite
safe (for a single number), too, since it is relatively unlikely that people
will be patching that source tarball they downloading.

> i've been thinking about this, and it seems like a problem best solved
> with keywords.


> perhaps a $RepositoryPath$ keyword that expands to the file's actual
> path in the repository, which would show you what branch/tag it's on.
> actually, we already have a $URL$ keyword, which looks like it would
> expand to what we want. you combine that with the $rev$ keyword and
> you can have something in each file that uniquely identifies what
> version and what branch it came from.


static const char __id__[] = "$URL$ $Rev$";

Just make sure that you set the svn:keywords property on each of the files
where you actually need to expand those keywords. For example:

$ svn pset svn:keywords "url rev" foo.c


Greg Stein, http://www.lyra.org/
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:09 2006

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.