Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 41237
Status: resolved
Priority: 0/
Queue: version

People
Owner: Nobody in particular
Requestors: stro [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Adding SVN $Id: $ support
Hi John, Is it possible to implement Subversion's $Id support in addition to CVS's $Revision? String format for Id keyword in SVN is similar to CVS, for example: $Id: filename.ext 123 2008-11-25 08:53:56Z stro $ 123 is the revision number. It is always integer. Maybe a value divided by 1000 can be a useful option. -- Serguei Trouchelle
I don't think I want to add yet another special-case parsing to the code. I already regret adding the support for CVS $Revision$ keyword, which seemed like a good idea at the time but now dooms me to have this one exceptional interface which I can't drop now. The Subversion revision number is not a version number; it is merely a monotonically increasing number in the repository history. In other words, two projects which share the same repo can change at different rates and their revision numbers have no relation to each other or really even to their own development history. Additionally, no algorithm I could come up with to transform the revision number into a conventional version number (like /1000) would fit everyone's needs, so I'd hate to pick just one. If you want to encode the revision number into the release $VERSION (so you can quickly determine which code a user is running), then add that to the "real" version number: # this all needs to be on a single line our $VERSION = qv('1.2'.qw$Id: filename.ext 123 2008-11-25 08:53:56Z stro $[2]); If you are running a Perl < 5.8.x, you need an additional set of parentheses -- e.g.(qw$blah$)[2] -- because you can't directly reference the individual list elements (you need to create an anonymous array first). Using the above code, you can increment the "VERSION" number (the '1.2' part) at whatever schedule you choose to release the code. But you also have the revision number as the last term of the $VERSION for quick reference. Sorry John