Take me over?
NAME
Dist::Zilla::Plugin::Version::FromSubversion - Use the revision of the working directory
VERSION
version 1.000008
SYNOPSIS
In dist.ini:
[Version::FromSubversion]
; optional, default is 1
major = 0
; optional, default is something like sprintf('%u.%06u', $major, $revision)
format = {{ $major }}.{{ sprintf('%06u', $revision) }}
To do a release:
$ svn update .
$ dzil release
DESCRIPTION
Using revision numbers of the versioning system is a *really bad* idea: that will not scale. For example, it will not work if you start to use branches and want to make releases from them because revision numbers are global, and not per branch. So keep this only for small projects and be prepared to change you version scheme if that goes wrong!
This plugin build a version number for a release from the Subversion revision number of the current directory.
Notes:
It is the user responsability to keep the directory up to date (with "
svn update .
"). The plugin currently does not even warn if the release is made from a directory which is not clean (everything committed).This plugin works only from a working copy of your repository. This means that the .svn directory must exists.
So this will not work from content extracted from the repository using
svn export
. If you want to make release from that context, use this instead:$ svn propset svn:keywords Revision dist.ini
In dist.ini:
[AutoVersion] major = 1 format = {{ $major }}.{{ sprintf '%06u', ("$Revision: $" =~ /(\d+)/) }}
SEE ALSO
Some suggestions of plugins to use in combination with this one:
AUTHOR
Olivier Mengué, mailto:dolmen@cpan.org.
Some code from Dist::Zilla::Plugin::AutoVersion by Ricardo Signes has been reused here.
COPYRIGHT AND LICENSE
Copyright © 2011 Olivier Mengué.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.