r65717 - in /trunk/libsvn-hooks-perl: Changes MANIFEST META.yml README debian/changelog lib/SVN/Hooks.pm lib/SVN/Hooks/CheckJira.pm lib/SVN/Hooks/Generic.pm t/02-generic.t

carnil at users.alioth.debian.org carnil at users.alioth.debian.org
Sat Dec 11 07:08:03 UTC 2010


Author: carnil
Date: Sat Dec 11 07:07:47 2010
New Revision: 65717

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=65717
Log:
New upstream release

Added:
    trunk/libsvn-hooks-perl/lib/SVN/Hooks/Generic.pm
      - copied unchanged from r65716, branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/Generic.pm
    trunk/libsvn-hooks-perl/t/02-generic.t
      - copied unchanged from r65716, branches/upstream/libsvn-hooks-perl/current/t/02-generic.t
Modified:
    trunk/libsvn-hooks-perl/Changes
    trunk/libsvn-hooks-perl/MANIFEST
    trunk/libsvn-hooks-perl/META.yml
    trunk/libsvn-hooks-perl/README
    trunk/libsvn-hooks-perl/debian/changelog
    trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm
    trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckJira.pm

Modified: trunk/libsvn-hooks-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/Changes?rev=65717&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/Changes (original)
+++ trunk/libsvn-hooks-perl/Changes Sat Dec 11 07:07:47 2010
@@ -1,4 +1,11 @@
 Revision history for SVN-Hooks. -*- text -*-
+
+0.31	2010-12-09
+
+	Implements the SVN::Hooks::Generic plugin to allow for the
+	easy creation of custom hooks.
+
+	Corrects CheckJira's "projects" verification.
 
 0.30	2010-10-07
 

Modified: trunk/libsvn-hooks-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/MANIFEST?rev=65717&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/MANIFEST (original)
+++ trunk/libsvn-hooks-perl/MANIFEST Sat Dec 11 07:07:47 2010
@@ -11,6 +11,7 @@
 lib/SVN/Hooks/CheckStructure.pm
 lib/SVN/Hooks/DenyChanges.pm
 lib/SVN/Hooks/DenyFilenames.pm
+lib/SVN/Hooks/Generic.pm
 lib/SVN/Hooks/JiraAcceptance.pm
 lib/SVN/Hooks/Mailer.pm
 lib/SVN/Hooks/Notify.pm
@@ -31,6 +32,7 @@
 t/02-checkstructure.t
 t/02-denychanges.t
 t/02-denyfilenames.t
+t/02-generic.t
 t/02-jiraacceptance.t
 t/02-mailer.t
 t/02-notify.t

Modified: trunk/libsvn-hooks-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/META.yml?rev=65717&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/META.yml (original)
+++ trunk/libsvn-hooks-perl/META.yml Sat Dec 11 07:07:47 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               SVN-Hooks
-version:            0.30
+version:            0.31
 abstract:           A framework for implementing Subversion hooks.
 author:
     - Gustavo Chaves <gnustavo at cpan.org>

Modified: trunk/libsvn-hooks-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/README?rev=65717&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/README (original)
+++ trunk/libsvn-hooks-perl/README Sat Dec 11 07:07:47 2010
@@ -1,6 +1,6 @@
 Name:    SVN-Hooks
 What:    Framework for Subversion hooks
-Version: 0.30
+Version: 0.31
 Author:  Gustavo Chaves <gnustavo at cpan.org>
 
 SVN-Hooks is a framework for creating Subversion hooks

Modified: trunk/libsvn-hooks-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/debian/changelog?rev=65717&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/debian/changelog (original)
+++ trunk/libsvn-hooks-perl/debian/changelog Sat Dec 11 07:07:47 2010
@@ -1,5 +1,6 @@
-libsvn-hooks-perl (0.30-2) UNRELEASED; urgency=low
+libsvn-hooks-perl (0.31-1) UNRELEASED; urgency=low
 
+  * New upstream release
   * Update my email address.
 
  -- Salvatore Bonaccorso <carnil at debian.org>  Sun, 10 Oct 2010 15:03:38 +0200

Modified: trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm?rev=65717&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm (original)
+++ trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm Sat Dec 11 07:07:47 2010
@@ -15,11 +15,11 @@
 
 =head1 VERSION
 
-Version 0.30
+Version 0.31
 
 =cut
 
-our $VERSION = '0.30';
+our $VERSION = '0.31';
 
 =head1 SYNOPSIS
 
@@ -178,6 +178,10 @@
 
 Deny the addition of files which file names doesn't comply with a
 Regexp. Usually used to disallow some characteres in the filenames.
+
+=item SVN::Hooks::Generic
+
+This meta plugin allows for the easy creation of custom made hooks.
 
 =item SVN::Hooks::Notify
 
@@ -336,7 +340,15 @@
 
     foreach my $conf (values %{$repo->{confs}}) {
 	if (my $hook = $conf->{$hook_name}) {
-	    $hook->($conf, @args);
+	    if (ref $hook eq 'CODE') {
+		$hook->($conf, @args);
+	    } elsif (ref $hook eq 'ARRAY') {
+		foreach my $h (@$hook) {
+		    $h->($conf, @args);
+		}
+	    } else {
+		die "SVN::Hooks: internal error!\n";
+	    }
 	}
     }
 

Modified: trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckJira.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckJira.pm?rev=65717&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckJira.pm (original)
+++ trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckJira.pm Sat Dec 11 07:07:47 2010
@@ -360,6 +360,15 @@
 
 		return unless @keys;
 
+		# Check if there is a restriction on the project keys allowed
+		if (exists $opts->{projects}) {
+		    foreach my $key (@keys) {
+			my ($pkey, $pnum) = split /-/, $key;
+			croak "$HOOK: issue $key is not allowed. You must cite only JIRA issues for the following projects: ", join(', ', sort keys %{$opts->{projects}}), ".\n"
+			    unless exists $opts->{projects}{$pkey};
+		    }
+		}
+
 		# Connect to JIRA if not yet connected.
 		unless (exists $conf->{jira}) {
 		    $conf->{jira} = eval {JIRA::Client->new(@{$conf->{conf}})};




More information about the Pkg-perl-cvs-commits mailing list