The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SVN::Simple::Hook::PostCommit - Role for Subversion post-commit hooks

VERSION

version 0.312

SYNOPSIS

    package MyHook::Cmd;
    use Any::Moose;
    extends any_moose('X::App::Cmd');

    package MyHook::Cmd::Command::post_commit;
    use Any::Moose;
    extends any_moose('X::App::Cmd::Command');
    with 'SVN::Simple::Hook::PostCommit';

    sub execute {
        my ( $self, $opt, $args ) = @_;

        warn $self->author, ' changed ',
            scalar keys %{ $self->root->paths_changed() }, " paths\n";

        return;
    }

DESCRIPTION

This Moose / Mouse role gives you access to the Subversion revision just committed for use in a post-commit hook. It's designed for use with MooseX / MouseX::App::Cmd::Command classes, so consult the main MooseX / MouseX::App::Cmd documentation for details on how to extend it to create your scripts.

ATTRIBUTES

revision_number

Revision number created by the commit.

author

The author of the current transaction as required by all SVN::Simple::Hook consumers.

root

The Subversion root node as required by all SVN::Simple::Hook consumers.

Example hooks/post-commit hook script

    #!/bin/sh

    REPOS="$1"
    REV="$2"

    perl -MMyHook::Cmd -e 'MyHook::Cmd->run()' post_commit -r "$REPOS" --rev "$REV" || exit 1
    exit 0

SUPPORT

Perldoc

You can find documentation for this module with the perldoc command.

  perldoc SVN::Simple::Hook

Websites

The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources.

Bugs / Feature Requests

Please report any bugs or feature requests through the web interface at https://github.com/mjgardner/svn-simple-hook/issues. You will be automatically notified of any progress on the request by the system.

Source Code

The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :)

https://github.com/mjgardner/svn-simple-hook

  git clone git://github.com/mjgardner/svn-simple-hook.git

AUTHOR

Mark Gardner <mjgardner@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by GSI Commerce.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.