r77228 - in /trunk/libsvn-hooks-perl: Changes META.yml README debian/changelog debian/compat debian/control lib/SVN/Hooks.pm lib/SVN/Hooks/CheckJira.pm lib/SVN/Hooks/UpdateConfFile.pm t/02-checkjira.t
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Fri Jul 8 12:56:49 UTC 2011
Author: angelabad-guest
Date: Fri Jul 8 12:56:46 2011
New Revision: 77228
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=77228
Log:
* New upstream release
* Bump to debhelper compat 8
Modified:
trunk/libsvn-hooks-perl/Changes
trunk/libsvn-hooks-perl/META.yml
trunk/libsvn-hooks-perl/README
trunk/libsvn-hooks-perl/debian/changelog
trunk/libsvn-hooks-perl/debian/compat
trunk/libsvn-hooks-perl/debian/control
trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm
trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckJira.pm
trunk/libsvn-hooks-perl/lib/SVN/Hooks/UpdateConfFile.pm
trunk/libsvn-hooks-perl/t/02-checkjira.t
Modified: trunk/libsvn-hooks-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/Changes?rev=77228&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/Changes (original)
+++ trunk/libsvn-hooks-perl/Changes Fri Jul 8 12:56:46 2011
@@ -1,4 +1,14 @@
Revision history for SVN-Hooks. -*- text -*-
+
+0.91 2011-07-07
+
+ CHECK_JIRA_CONFIG accepts a fifth argument to match JIRA
+ project keys.
+
+ Fixes an error on UpdateConfFile.
+
+ Configuration files should be optional, but they were always
+ required. Now it's fixed.
0.90 2011-05-14
Modified: trunk/libsvn-hooks-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/META.yml?rev=77228&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/META.yml (original)
+++ trunk/libsvn-hooks-perl/META.yml Fri Jul 8 12:56:46 2011
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: SVN-Hooks
-version: 0.90
+version: 0.91
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=77228&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/README (original)
+++ trunk/libsvn-hooks-perl/README Fri Jul 8 12:56:46 2011
@@ -1,6 +1,6 @@
Name: SVN-Hooks
What: Framework for Subversion hooks
-Version: 0.90
+Version: 0.91
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=77228&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/debian/changelog (original)
+++ trunk/libsvn-hooks-perl/debian/changelog Fri Jul 8 12:56:46 2011
@@ -1,3 +1,10 @@
+libsvn-hooks-perl (0.91-1) unstable; urgency=low
+
+ * New upstream release
+ * Bump to debhelper compat 8
+
+ -- Angel Abad <angelabad at gmail.com> Fri, 08 Jul 2011 14:56:33 +0200
+
libsvn-hooks-perl (0.90-1) unstable; urgency=low
* New upstream release
Modified: trunk/libsvn-hooks-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/debian/compat?rev=77228&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/debian/compat (original)
+++ trunk/libsvn-hooks-perl/debian/compat Fri Jul 8 12:56:46 2011
@@ -1,1 +1,1 @@
-7
+8
Modified: trunk/libsvn-hooks-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/debian/control?rev=77228&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/debian/control (original)
+++ trunk/libsvn-hooks-perl/debian/control Fri Jul 8 12:56:46 2011
@@ -1,7 +1,12 @@
Source: libsvn-hooks-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 7)
+Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
+Uploaders: Angel Abad <angelabad at gmail.com>,
+ Jonathan Yu <jawnsy at cpan.org>,
+ gregor herrmann <gregoa at debian.org>,
+ Salvatore Bonaccorso <carnil at debian.org>
+Build-Depends: debhelper (>= 8)
Build-Depends-Indep: libemail-send-perl,
libemail-simple-perl (>= 2.100) | libemail-simple-creator-perl,
libjira-client-perl,
@@ -10,15 +15,10 @@
libsvn-notify-perl,
perl,
subversion
-Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Angel Abad <angelabad at gmail.com>,
- Jonathan Yu <jawnsy at cpan.org>,
- gregor herrmann <gregoa at debian.org>,
- Salvatore Bonaccorso <carnil at debian.org>
Standards-Version: 3.9.2
+Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libsvn-hooks-perl/
+Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libsvn-hooks-perl/
Homepage: http://search.cpan.org/dist/SVN-Hooks/
-Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libsvn-hooks-perl/
-Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libsvn-hooks-perl/
Package: libsvn-hooks-perl
Architecture: all
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=77228&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm (original)
+++ trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm Fri Jul 8 12:56:46 2011
@@ -17,11 +17,11 @@
=head1 VERSION
-Version 0.90
+Version 0.91
=cut
-our $VERSION = '0.90';
+our $VERSION = '0.91';
our @Conf_Files = ('conf/svn-hooks.conf');
our $Repo = undef;
@@ -38,6 +38,7 @@
# Reload all configuration files
foreach my $conf (@Conf_Files) {
+ next unless -e "$Repo/$conf"; # Configuration files are optional
package main;
unless (my $return = do "$Repo/$conf") {
die "couldn't parse '$Repo/$conf': $@\n" if $@;
@@ -147,14 +148,14 @@
use SVN::Hooks;
START_COMMIT {
- my ($repo_path, $username, $capabilities) = @_;
+ my ($repo_path, $username, $capabilities) = @_;
# ...
- }
+ };
PRE_COMMIT {
my ($svnlook) = @_;
# ...
- }
+ };
run_hook($0, @ARGV);
@@ -193,7 +194,7 @@
A hook is a specifically named program that is called by the
Subversion server during the execution of some operations. There are
-exactly nine hooks which must reside under the C<conf> directory in
+exactly nine hooks which must reside under the C<hooks> directory in
the repository. When you create a new repository, you get nine
template files in this directory, all of them having the C<.tmpl>
suffix and helpful instructions inside explaining how to convert them
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=77228&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckJira.pm (original)
+++ trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckJira.pm Fri Jul 8 12:56:46 2011
@@ -29,7 +29,7 @@
It's configured by the following directives.
-=head2 CHECK_JIRA_CONFIG(BASEURL, LOGIN, PASSWORD, [REGEXP])
+=head2 CHECK_JIRA_CONFIG(BASEURL, LOGIN, PASSWORD [, REGEXP [, REGEXP]])
This directive specifies how to connect and to authenticate to the
JIRA server. BASEURL is the base URL of the JIRA server, usually,
@@ -37,15 +37,22 @@
the credentials of a JIRA user who has browsing rights to the JIRA
projects that will be referenced in the commit logs.
-The fourth argument is optional. It must be a qr/Regexp/ object that
-will be used to match against the commit logs in order to extract the
-list of JIRA issue keys. By default, the JIRA keys are looked for in
-the whole commit log. Sometimes this can be suboptimal because the
-user can introduce in the message some text that inadvertently looks
-like a JIRA issue key whithout being so. With this argument, the log
-message is matched against the REGEXP and only the first matched group
-(i.e., the part of the message captured by the first parenthesis
-(C<$1>)) is used to look for JIRA issue keys.
+The fourth argument is an optional qr/Regexp/ object. It will be used
+to match against the commit logs in order to extract the list of JIRA
+issue keys. By default, the JIRA keys are looked for in the whole
+commit log, which is equivalent to qr/(.*)/. Sometimes this can be
+suboptimal because the user can introduce in the message some text
+that inadvertently looks like a JIRA issue key whithout being so. With
+this argument, the log message is matched against the REGEXP and only
+the first matched group (i.e., the part of the message captured by the
+first parenthesis (C<$1>)) is used to look for JIRA issue keys.
+
+The fifth argument is another optional qr/Regexp/ object. It is used
+to match JIRA project keys, which match qr/[A-Z]{2,}/ by
+default. However, since you can specify different patterns for JIRA
+project keys
+(L<http://confluence.atlassian.com/display/JIRA/Configuring+Project+Keys>),
+you need to be able to specify this here too.
The JIRA issue keys are extracted from the commit log (or the part of
it specified by the REGEXP) with the following pattern:
@@ -53,7 +60,7 @@
=cut
-my ($BaseURL, $Login, $Passwd, $Match);
+my ($BaseURL, $Login, $Passwd, $MatchLog, $MatchKey);
my $JIRA;
my @Checks;
my %Defaults = (
@@ -64,18 +71,24 @@
);
sub CHECK_JIRA_CONFIG {
- ($BaseURL, $Login, $Passwd, $Match) = @_;
-
- if (@_ == 3) {
- $Match = qr/(.*)/;
- }
- elsif (@_ == 4) {
- ref $Match eq 'Regexp'
+ ($BaseURL, $Login, $Passwd, $MatchLog, $MatchKey) = @_;
+
+ if (defined $MatchKey) {
+ ref $MatchKey && ref $MatchKey eq 'Regexp'
+ or croak "CHECK_JIRA_CONFIG: fifth argument must be a Regexp.\n";
+ } else {
+ $MatchKey = qr/[A-Z]{2,}/;
+ }
+
+ if (defined $MatchLog) {
+ ref $MatchLog && ref $MatchLog eq 'Regexp'
or croak "CHECK_JIRA_CONFIG: fourth argument must be a Regexp.\n";
- }
- else {
- croak "CHECK_JIRA_CONFIG: requires three or four arguments.\n";
- }
+ } else {
+ $MatchLog = qr/[A-Z]{2,}/;
+ }
+
+ @_ >= 3 && @_ <= 5
+ or croak "CHECK_JIRA_CONFIG: requires three, four, or five arguments.\n";
$BaseURL =~ s/\/+$//;
@@ -337,8 +350,8 @@
if ($file =~ $regex) {
# Grok the JIRA issue keys from the commit log
- my ($match) = ($svnlook->log_msg() =~ $Match);
- my @keys = defined $match ? $match =~ /\b[A-Z]+-\d+\b/g : ();
+ my ($match) = ($svnlook->log_msg() =~ $MatchLog);
+ my @keys = defined $match ? $match =~ /\b$MatchKey-\d+\b/g : ();
my %opts = (%Defaults, %$opts);
Modified: trunk/libsvn-hooks-perl/lib/SVN/Hooks/UpdateConfFile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/lib/SVN/Hooks/UpdateConfFile.pm?rev=77228&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/lib/SVN/Hooks/UpdateConfFile.pm (original)
+++ trunk/libsvn-hooks-perl/lib/SVN/Hooks/UpdateConfFile.pm Fri Jul 8 12:56:46 2011
@@ -339,7 +339,7 @@
close $th;
local $ENV{SVNREPOPATH} = $repo_path;
- if (system("$cmd $temp/file 1>$temp/output 2>$temp/error") == 0) {
+ if (system("$cmd $temp/file $path 1>$temp/output 2>$temp/error") == 0) {
return `cat $temp/output`;
}
else {
Modified: trunk/libsvn-hooks-perl/t/02-checkjira.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/t/02-checkjira.t?rev=77228&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/t/02-checkjira.t (original)
+++ trunk/libsvn-hooks-perl/t/02-checkjira.t Fri Jul 8 12:56:46 2011
@@ -40,7 +40,7 @@
CHECK_JIRA_CONFIG();
EOS
-work_nok('config sans args', 'CHECK_JIRA_CONFIG: requires three or four arguments', work(''));
+work_nok('config sans args', 'CHECK_JIRA_CONFIG: requires three, four, or five arguments', work(''));
set_conf(<<'EOS');
CHECK_JIRA_CONFIG('http://jira.atlassian.com/', 'user', 'pass', 'asdf');
More information about the Pkg-perl-cvs-commits
mailing list