NAME

SVN::Simple::Hook::PreCommit - Role for Subversion pre-commit hooks

VERSION

version 0.110071

SYNOPSIS

package MyHook::Cmd;
use Moose;
extends 'MooseX::App::Cmd';

package MyHook::Cmd::Command::pre_commit;
use Moose;
extends 'MooseX::App::Cmd::Command';
with 'SVN::Simple::Hook::PreCommit';

sub execute {
    my ( $self, $opt, $args ) = @_;
    my $txn = $self->txn();
    
    warn $txn->prop('svn:author'), ' changed ',
        scalar keys %{ $txn->root->paths_changed() }, " paths\n";
    
    return;
}

1;

DESCRIPTION

ATTRIBUTES

txn_name

Full name of the transaction to check in the repository.

In your repository's hooks/pre-commit file:

#!/bin/sh

REPOS="$1"
TXN="$2"

perl -MMyHook::Cmd -e 'MyHook::Cmd->run()' pre_commit -r "$REPOS" -t "$TXN" || exit 1
exit 0

AUTHOR

Mark Gardner <mjgardner@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 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.