[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: Andy Levy <andy.levy_at_gmail.com>
Date: 2006-12-14 20:47:47 CET

On 12/13/06, j.j.green <j.j.green@shef.ac.uk> wrote:
>
> Hi
>
> I'm a recent refugee from PRCS and am kind of stuck on a problem.
> PRCS has major/minor version keywords which I can get into my
> programs easily:
>
> /* $Format: "#define PROJECT_VER_MAJ $ProjectMajorVersion$" $ */
> #define PROJECT_VER_MAJ 5
> /* $Format: "#define PROJECT_VER_MIN $ProjectMinorVersion$" $ */
> #define PROJECT_VER_MIN 39
>
> and then I have my programs print
>
> This is program (version 5.39)
>
> when they operate verbosely. I get that for subversion I need to use
> tags to hold the human-readable release-version, and these are
> disconnected from the revision. I guess that I will need to do some
> scripting in order to get a release version into my C & perl programs.
> Im thinking a script that
> - pulls a release-version.txt file from the repository
> - read and increments the version in that file to "5.30"
> - checks the file back in
> - checks out a C header and writes the release-version as a #define RELVER
> 5.30
> - checks the file back in
> - creates the tagged release as tags/program-5.30
>
> 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";
>
> So this is going to get cumbersome. I've searched around but can't find
> a slick way to do this. I've seen the FAQ on getting the revision into C,
> but I'm after insertng the *tag*
>
> I'd be most grateful for suggestions

Unlike CVS and some other version control systems, tags in Subversion
are nothing more than copies. The "difference" is in the significance
that the user applies to the contents/names in the tags directory.

So, if you want to do this, I think you're looking at doing some
path-reading and parsing to update the file contents.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Dec 14 20:48:48 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.