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

Re: Get tag (not revision) into C & perl programs

From: Martin Scharrer <mailinglists_at_madmarty.de>
Date: 2006-12-17 14:24:18 CET


On Wednesday 13 December 2006 22:50, j.j.green wrote:
> This is OK for C. But I have around 60 perl programs which use the same
> PCRS mechanism:
> # The version: $Format: my "\$version = \"$ProjectVersion$\";"$
> my $version = "5.39";

> I'd be most grateful for suggestions
If you just like to have the project version coded as tag, i.e. it's SVN URL
looks like this:
(Protocol could vary)
then just do something like this:

Set the svn:keywords property to 'URL' to include the URL and write something
like this into your Perl scripts:

my $version = ( '$URL$' =~ m{/tags/version(.*?)/} && $1 );
(my $version = '$URL$') =~ s{.*/tags/version(.*?)/.*}{$1};
my $version = ( '$URL$' =~ m{/tags/version(.*?)/} ) ? $1 : undef;

The $URL$ is of course expanded in your Perls script.

 - You need a consistant tagging system
 - Works only if you build the checked-out tagged version not a branch or the

I hope this helps you,

or some

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Dec 17 14:26:23 2006

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.