Looking for help!The maintainer of this distribution is looking for people to help them improve this module! If you're interested then please contact them via email.
SVN::Notify::Snapshot - Take snapshots from Subversion activity
This document describes version 0.04 of SVN::Notify::Snapshot, released June 28, 2008.
Use svnnotify in post-commit:
svnnotify --repos-path "$1" --revision "$2" \ --to "/tmp/snapshot-$2.tar.gz" --handler Snapshot \ [--append-rev] --handle-path pathname [options] [--tag-regex]
or as part of a SVN::Notify::Config YAML file:
#!/usr/bin/perl -MSVN::Notify::Config=$0 --- #YAML:1.0 '': PATH: "/usr/local/bin:/usr/bin" '/project1/trunk': handler: Snapshot append-rev: 1 to: "/srv/www/htdocs/snapshot.tgz"
Produce snapshots of a repository path. Typically used as part of a postcommit script, which will automatically e.g. a trunk-latest.tar.gz file for every commit to a specified path.
As a subclass of SVN::Notify, there are several ways to integrate this module into your postcommit script:
- 1. postcommit script
Add a line to an existing postcommit script that sets the
--handlercommandline option to "Snapshot". This method has the drawback that it will require multiple Perl interpreters to start up (one per handler line), which will delay the commit from completing on the client. Unless you use
--to-regex-map, it will also mean that each line will be called for each revision committed, even if the path of interest hasn't changed.
- 2. SVN::Notify::Config stanza
Multiple handlers can be configured in a single SVN::Notify::Config YAML file, which acts both as the configuration data as well as the postcommit script itself. This method also ensures that the Snapshot handler will only be called when a change is made to the associated path (like
--to-regex-mapin the commandline case).
In addition to all of the options available to the base SVN::Notify class, there are several that are specific to the Snapshot handler.
This commandline argument specifies the portion of the repository to take snapshot from, is not optional. It will be automatically set when using either
--to-regex-mapor when executed within a SVN::Notify::Config script, however.
By default, the base path inside the snapshot will be the basename of the
--toargument, but you may override it with
--snapshot-base. For example, if you are taking a snapshot of
project1/trunk, you may want to set the snapshot-base to "project1" instead.
If you are passing both the
--toarguments to svnnotify on the commandline, you can always construct the filename to include the revision by using shell substitution variables (like the example in the SYNOPSIS. However, if you are using a YAML config file or the
--to-regex-mapcommandline option, you may want to use the
append-revoption, which will insert a hyphen and the revision into the destination filename between the basename and the suffix.
For example, in the SYNOPSIS above, the YAML stanza will generate files like:
/srv/www/htdocs/snapshot-1.tgz /srv/www/htdocs/snapshot-5.tgz /srv/www/htdocs/snapshot-6.tgz
assuming that the
/project1/trunkchanged in revs 1, 5, and 6.
John Peacock <email@example.com>
Autrijus Tang <firstname.lastname@example.org>
No bugs have been reported.
Please report any bugs or feature requests to
email@example.com, or through the web interface at http://rt.cpan.org.
Copyright (c) 2007-2008 John Peacock <firstname.lastname@example.org>.
Portions copyright 2004 by Autrijus Tang <email@example.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.