#!/usr/bin/perl # POST-COMMIT HOOK # # [1] REPOS-PATH (the path to this repository) # [2] REV (the number of the revision just committed) use Mail::Mailer; use warnings; use strict; ################ # my $MAIL = 'notification email'; # ################ my $REPO = $ARGV[0]; my $REV = $ARGV[1]; my $REPO_ = quotemeta($REPO); #my $MAIL = 'piotr@larroy.com'; my $AUTHOR = `svnlook author $REPO_`; chomp $AUTHOR; my $CHANGED = `svnlook changed $REPO_`; my $LOG = `svnlook log $REPO_`; my $DATE = `svnlook date $REPO_`; chomp $DATE; my @tmp = (split(/\//,$REPO)); my $REPO_NAME = $tmp[-1]; my $mailer = new Mail::Mailer "sendmail"; my $subject = $AUTHOR.' committed revision '.$REV.' on '.$REPO_NAME.' repository'; my $body = <open({ From => $MAIL, To => $MAIL, Subject => $subject, }) or die "Can't open: $!\n"; print $mailer $body; $mailer->close();