Created
April 23, 2010 19:43
-
-
Save milmazz/377068 to your computer and use it in GitHub Desktop.
Subversion's post-commit hook (svn-notify)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
use SVN::Notify; | |
my $path = $ARGV[0]; | |
my $rev = $ARGV[1]; | |
my %params = ( | |
repos_path => $path, | |
revision => $rev, | |
handler => 'HTML::ColorDiff', | |
trac_url => 'http://trac.example.com/project', | |
filters => ['Trac'], | |
with_diff => 1, | |
diff_switches => '--no-diff-added --no-diff-deleted', | |
subject_cx => 1, | |
strip_cx_regex => [ '^trunk/', '^branches/', '^tags/' ], | |
footer => 'Administrado por: BOFH <[email protected]>', | |
max_sub_length => 72, | |
max_diff_length => 1024, | |
from => '[email protected]', | |
subject_prefix => '[project]', | |
smtp => 'smtp.example.com', | |
smtp_user => 'example', | |
smtp_pass => 'example', | |
); | |
my $developers = '[email protected]'; | |
my $admins = '[email protected]'; | |
$params{to_regex_map} = { | |
$developers => '^trunk|^branches', | |
$admins => '^tags|^trunk' | |
}; | |
my $notifier = SVN::Notify->new(%params); | |
$notifier->prepare; | |
$notifier->execute; | |
__END__ | |
=head1 Name | |
post-commit - Subversion's post-commit hook using SVN::Notify | |
=head1 Usage | |
post-commit PATH REVISION | |
=head1 Options | |
PATH Path to the Subversion repository. Required. | |
REVISION Commit revision number. Required. | |
=head1 Author | |
Milton Mazzarri <[email protected]> | |
=head1 Copyright and License | |
Copyright (c) 2010 Milton Mazzarri. Some Rights Reserved. | |
This script is free software; you can redistribute it and/or modify it under | |
the same terms as Perl itself. | |
=cut |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment