in reply to Perl/SVN/versioning - ideas?

You can use SVN's automatic keyword expansion:

our $VERSION = '1.20.$Rev$'; ...

And enable it for that file:

svn propset svn:keywords "Rev" yourfile.pl

Note that this expansion happens on the client side, so be sure to check if all SVN clients involved with the project support it (most do, for example the 'svn' command line client).

Replies are listed 'Best First'.
Re^2: Perl/SVN/versioning - ideas?
by DreamT (Pilgrim) on Aug 02, 2011 at 16:19 UTC
    I've looked into that, but the problem is that that revision only applies to the current file - I want the revision for the latest submitted set of files (Base revision). This since the application consists of several files.
      Then install a post-commit hook that writes the revision into a special file, and read that for determining the revision.

      But be careful when you do releases, it might be better to hardcode the version in the .pl and .pm files in released versions of your app.

        Then install a post-commit hook that writes the revision into a special file, and read that for determining the revision.

        If the file looks like:

        package Project::Version; use strict; use warnings; use Exporter qw( import ); our @EXPORT = qw( $VERSION ); our $VERSION = ...; 1;

        Then use Project::Version; will import $VERSION into the caller.