You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Hanjy <ha...@gmail.com> on 2005/11/30 10:05:09 UTC

A new revsion keyword request

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

Thanks for considering this.

Han

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: A new revsion keyword request

Posted by Ryan Schmidt <su...@ryandesign.com>.
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

Re: A new revsion keyword request

Posted by Marcus Rohrmoser <mr...@gmx-gmbh.de>.
Hanjy schrieb:
> 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
> 
> Thanks for considering this.

Why don't you do a string manipulation in the DEFINE, eg

#define VERSION extractRevision("$Revision$")

Greetings,
	M