NAME

Dist::Zilla::Plugin::Version::FromSubversion - Use the revision of the working directory

VERSION

version 1.000017

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) }}
; optional. The svn:keywords property must be set to 'Revision' on dist.ini
fallback_revision = $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.

The fallback_revision option can be used for the cases where the distribution is not built from a working copy but from an export (svn export). For example, integration tools such as Jenkins. For this case we are using the svn:keywords property on dist.ini to be able to retrieve the revision number from a known place.

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).

EXAMPLE

This distribution is built with itself. You can checkout its Subversion repository from Google Code:

svn checkout http://dist-zilla-plugin-version-fromsubversion.googlecode.com/svn/trunk/ DZ-P-Version-FromSubversion

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.