| 1 | package SVN::Hooks::Notify; | ||
| 2 | # ABSTRACT: Subversion activity notification. | ||
| 3 | $SVN::Hooks::Notify::VERSION = '1.35'; | ||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | |||
| 7 | use SVN::Hooks; | ||
| 8 | |||
| 9 | use Exporter qw/import/; | ||
| 10 | my $HOOK = 'NOTIFY'; | ||
| 11 | our @EXPORT = qw/NOTIFY_DEFAULTS NOTIFY/; | ||
| 12 | |||
| 13 | |||
| 14 | my %Defaults; | ||
| 15 | |||
| 16 | sub NOTIFY_DEFAULTS { | ||
| 17 | %Defaults = @_; | ||
| 18 | |||
| 19 | return 1; | ||
| 20 | } | ||
| 21 | |||
| 22 | |||
| 23 | my %Options; | ||
| 24 | |||
| 25 | sub NOTIFY { | ||
| 26 | %Options = @_; | ||
| 27 | |||
| 28 | POST_COMMIT(\&post_commit); | ||
| 29 | |||
| 30 | return 1; | ||
| 31 | }; | ||
| 32 | |||
| 33 | sub post_commit { | ||
| 34 | my ($svnlook) = @_; | ||
| 35 | |||
| 36 | require SVN::Notify; | ||
| 37 | |||
| 38 | my $notifier = SVN::Notify->new( | ||
| 39 | %Defaults, | ||
| 40 | %Options, | ||
| 41 | repos_path => $svnlook->repo(), | ||
| 42 | revision => $svnlook->rev(), | ||
| 43 | ); | ||
| 44 | $notifier->prepare; | ||
| 45 | $notifier->execute; | ||
| 46 | return; | ||
| 47 | } | ||
| 48 | |||
| 49 | 1; # End of SVN::Hooks::Notify | ||
| 50 | |||
| 51 | __END__ |