You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Richard Curnow <rc...@rc0.org.uk> on 2003/04/29 22:17:57 UTC

Embedding tag name in files

I use the following behaviour with CVS, and was wondering how I can
achieve it with subversion.

With CVS, I embed $Name$ in the source somewhere, e.g. as 

static char *version = "$Name";

Now when I release the code, I tag the repository

cvs rtag VX_Y project

Then when I do 'cvs export -r VX_Y project' to get the source tree from
which the tarball is created, the $Name$ string is replaced by VX_Y.
Inside the program, I can process this to report the program version to
service the --version switch etc.

I can't see an obvious way to do the equivalent in subversion.  How do
people embed released s/w versions inside the program source?  (Other
than the obvious hand editing a file, committing that then forking the
tagged version of the trunk - I'd like to avoid this kind of thing.)

Cheers

-- 
Richard P. Curnow | Free software fundamentalist
Weston-super-Mare | 
United Kingdom    | http://www.rc0.org.uk/

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

Re: Embedding tag name in files

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Tuesday, April 29, 2003, at 06:17 PM, Richard Curnow wrote:

> I use the following behaviour with CVS, and was wondering how I can
> achieve it with subversion.
>
> With CVS, I embed $Name$ in the source somewhere, e.g. as
>
> static char *version = "$Name";
>
> Now when I release the code, I tag the repository
>
> cvs rtag VX_Y project
>
> Then when I do 'cvs export -r VX_Y project' to get the source tree from
> which the tarball is created, the $Name$ string is replaced by VX_Y.
> Inside the program, I can process this to report the program version to
> service the --version switch etc.
>
> I can't see an obvious way to do the equivalent in subversion.  How do
> people embed released s/w versions inside the program source?  (Other
> than the obvious hand editing a file, committing that then forking the
> tagged version of the trunk - I'd like to avoid this kind of thing.)

the $URL$ keyword seems like the subversion equivalent of this 
functionality.

-garrett


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