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

Re: A new revsion keyword request

From: Ryan Schmidt <subversion-2005_at_ryandesign.com>
Date: 2005-11-30 11:59:47 CET

On Nov 30, 2005, at 11:05, Hanjy wrote:

> I want a new keyword such as Revsion2, etc.
> it will be replaced to a new formated line that include the revsion
> value.
> Usage:
> $Revsion2:Format_string$
>
> in format_string, the % will be replace to revsion value.
>
> example, in my resource file: xx.rc
>
> //$Revsion2:#define VERSION 2.0.0.%$
>
>
> it will be replaced to:
>
> //$Revsion2:#define VERSION 2.0.0.%$
> #define VERSION 2.0.0.63

Just to make sure you know what you're asking for: $Revision$ is the
revision in which the file was last modified. So if you have a header
file that's supposed to define the revision of the project as a
whole, then that won't work unless you actually modify that specific
header file every time you release a new version of a project, and
that's not particularly practical or efficient. The best way to get
"the revision" of the project (for example if you're trying to
display it in the about box of your program) is, as part of your
build process, to use the svnversion program and put its output into
a file that is then used by your project. This could be a text file
which you read in, or it could be a piece of code that you then build
into the project. The latter is shown here:

http://subversion.tigris.org/faq.html#version-value-in-source

But if you do in fact care only about the revision of the specific
file that the keyword is in (the revision when that file was last
modified), then the solutions are to use $Revision$ in a string and
then write code into your project to extract what you want out of it,
or your proposed $Revision2$ keyword. You can of course also modify
the svnversion technique and just run it on the one file whose
revision number you want to know. But that gets tedious if you have
many files whose revision you want to get.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Nov 30 12:36:00 2005

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.