r63445 - in /trunk/libsvn-hooks-perl: ./ debian/ debian/patches/ lib/SVN/ lib/SVN/Hooks/ t/
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Wed Oct 6 21:15:54 UTC 2010
Author: angelabad-guest
Date: Wed Oct 6 21:15:43 2010
New Revision: 63445
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63445
Log:
* New upstream release
* debian/copyright: Update license information
* debian/patches/pod.patch: Update patch
* Bump Standards-Version to 3.9.1 (no changes)
Modified:
trunk/libsvn-hooks-perl/Changes
trunk/libsvn-hooks-perl/META.yml
trunk/libsvn-hooks-perl/README
trunk/libsvn-hooks-perl/TODO
trunk/libsvn-hooks-perl/debian/changelog
trunk/libsvn-hooks-perl/debian/control
trunk/libsvn-hooks-perl/debian/copyright
trunk/libsvn-hooks-perl/debian/patches/pod.patch
trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm
trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckMimeTypes.pm
trunk/libsvn-hooks-perl/lib/SVN/Hooks/DenyFilenames.pm
trunk/libsvn-hooks-perl/lib/SVN/Hooks/JiraAcceptance.pm
trunk/libsvn-hooks-perl/t/02-denyfilenames.t
trunk/libsvn-hooks-perl/t/02-updateconffile.t
Modified: trunk/libsvn-hooks-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/Changes?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/Changes (original)
+++ trunk/libsvn-hooks-perl/Changes Wed Oct 6 21:15:43 2010
@@ -1,4 +1,9 @@
Revision history for SVN-Hooks. -*- text -*-
+
+0.29 2010-10-06
+
+ Extends the syntax of DENY_FILENAME directive to allow
+ customized error messages.
0.28 2010-04-28
Modified: trunk/libsvn-hooks-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/META.yml?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/META.yml (original)
+++ trunk/libsvn-hooks-perl/META.yml Wed Oct 6 21:15:43 2010
@@ -1,21 +1,29 @@
--- #YAML:1.0
-name: SVN-Hooks
-version: 0.28
-abstract: A framework for implementing Subversion hooks.
-license: ~
-author:
+name: SVN-Hooks
+version: 0.29
+abstract: A framework for implementing Subversion hooks.
+author:
- Gustavo Chaves <gnustavo at cpan.org>
-generated_by: ExtUtils::MakeMaker version 6.42
-distribution_type: module
-requires:
- Email::Send: 0
- Email::Simple: 0
- Email::Simple::Creator: 0
- JIRA::Client: 0
- SVN::Look: 0
- SVN::Notify: 0
- Test::More: 0
- XMLRPC::Lite: 0
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ Email::Send: 0
+ Email::Simple: 0
+ Email::Simple::Creator: 0
+ JIRA::Client: 0
+ SVN::Look: 0
+ SVN::Notify: 0
+ Test::More: 0
+ XMLRPC::Lite: 0
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.55_02
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: trunk/libsvn-hooks-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/README?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/README (original)
+++ trunk/libsvn-hooks-perl/README Wed Oct 6 21:15:43 2010
@@ -1,6 +1,6 @@
Name: SVN-Hooks
What: Framework for Subversion hooks
-Version: 0.28
+Version: 0.29
Author: Gustavo Chaves <gnustavo at cpan.org>
SVN-Hooks is a framework for creating Subversion hooks
Modified: trunk/libsvn-hooks-perl/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/TODO?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/TODO (original)
+++ trunk/libsvn-hooks-perl/TODO Wed Oct 6 21:15:43 2010
@@ -36,3 +36,16 @@
http://svn.collab.net/viewvc/svn/trunk/contrib/hook-scripts/case-insensitive.py
* Make each plugin an object factory.
+
+- Move repo to github.
+
+- Substitute Module::Build for ExtUtils::MakeMaker
+
+- investigate Dist::Zilla
+
+- Use a xt/ directory for author tests
+
+- use utf8
+
+- perhaps use open
+
Modified: trunk/libsvn-hooks-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/debian/changelog?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/debian/changelog (original)
+++ trunk/libsvn-hooks-perl/debian/changelog Wed Oct 6 21:15:43 2010
@@ -1,3 +1,12 @@
+libsvn-hooks-perl (0.29-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/copyright: Update license information
+ * debian/patches/pod.patch: Update patch
+ * Bump Standards-Version to 3.9.1 (no changes)
+
+ -- Angel Abad <angelabad at gmail.com> Wed, 06 Oct 2010 23:08:42 +0200
+
libsvn-hooks-perl (0.28-1) unstable; urgency=low
* New upstream release
Modified: trunk/libsvn-hooks-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/debian/control?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/debian/control (original)
+++ trunk/libsvn-hooks-perl/debian/control Wed Oct 6 21:15:43 2010
@@ -9,7 +9,7 @@
Uploaders: Angel Abad <angelabad at gmail.com>, Jonathan Yu <jawnsy at cpan.org>,
gregor herrmann <gregoa at debian.org>,
Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
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/
Modified: trunk/libsvn-hooks-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/debian/copyright?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/debian/copyright (original)
+++ trunk/libsvn-hooks-perl/debian/copyright Wed Oct 6 21:15:43 2010
@@ -8,18 +8,19 @@
License: Artistic or GPL+1
Files: debian/*
-Copyright: 2010, Jonathan Yu <jawnsy at cpan.org>
- 2009-2010, Angel Abad <angelabad at gmail.com>
- 2009-2010, Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
+Copyright: 2009, 2010, Angel Abad <angelabad at gmail.com>
+ 2009, 2010, Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
+ 2009, Angel Abad (Ikusnet SLL) <angel at grupoikusnet.com>
2009, gregor herrmann <gregoa at debian.org>
-License: Artistic or GPL-1+
+ 2010, Jonathan Yu <jawnsy at cpan.org>
+License: unparsable or Artistic or GPL-1+
License: Artistic
This program is free software; you can redistribute it and/or modify
it under the terms of the Artistic License, which comes with Perl.
.
On Debian GNU/Linux systems, the complete text of the Artistic License
- can be found in `/usr/share/common-licenses/Artistic'
+ can be found in `/usr/share/common-licenses/Artistic'.
License: GPL-1+
This program is free software; you can redistribute it and/or modify
@@ -27,5 +28,5 @@
the Free Software Foundation; either version 1, or (at your option)
any later version.
.
- On Debian GNU/Linux systems, the complete text of the GNU General
- Public License can be found in `/usr/share/common-licenses/GPL'
+ On Debian GNU/Linux systems, the complete text of version 1 of the
+ General Public License can be found in `/usr/share/common-licenses/GPL-1'.
Modified: trunk/libsvn-hooks-perl/debian/patches/pod.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/debian/patches/pod.patch?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/debian/patches/pod.patch (original)
+++ trunk/libsvn-hooks-perl/debian/patches/pod.patch Wed Oct 6 21:15:43 2010
@@ -20,9 +20,9 @@
alert interested parties about the commit just done.
-There are several useful L<hook scripts
--available|http://subversion.tigris.org/tools_contrib.html#hook_scripts>,
+-available|http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/>,
+There are several useful hook scripts
-+available at L<http://subversion.tigris.org/tools_contrib.html#hook_scripts>,
++available at Lhttp://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/>,
mainly for those three associated with the commit operation. However,
when you try to combine the functionality of two or more of those
scripts in a single hook you normally end up facing two problems.
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=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm (original)
+++ trunk/libsvn-hooks-perl/lib/SVN/Hooks.pm Wed Oct 6 21:15:43 2010
@@ -15,11 +15,11 @@
=head1 VERSION
-Version 0.28
+Version 0.29
=cut
-our $VERSION = '0.28';
+our $VERSION = '0.29';
=head1 SYNOPSIS
@@ -54,8 +54,8 @@
=head1 USER TUTORIAL
In order to really understand what this is all about you'll need to
-understand L<Subversion|http://subversion.tigris.org/> and its
-L<hooks|http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html#svn.reposadmin.create.hooks>.
+understand Subversion L<http://subversion.tigris.org/> and its
+hooks L<http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html#svn.reposadmin.create.hooks>.
Subversion is a version control system, and as such it is used to
maintain current and historical versions of files and
@@ -89,8 +89,8 @@
comply to a set of policies. The C<post-commit> can be used to log or
alert interested parties about the commit just done.
-There are several useful L<hook scripts
-available|http://subversion.tigris.org/tools_contrib.html#hook_scripts>,
+There are several useful hook scripts
+available at Lhttp://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/>,
mainly for those three associated with the commit operation. However,
when you try to combine the functionality of two or more of those
scripts in a single hook you normally end up facing two problems.
@@ -147,7 +147,7 @@
=item SVN::Hooks::CheckJira
Integrate Subversion with the
-L<JIRA|http://www.atlassian.com/software/jira/> ticketing system.
+JIRA L<http://www.atlassian.com/software/jira/> ticketing system.
=item SVN::Hooks::CheckLog
Modified: trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckMimeTypes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckMimeTypes.pm?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckMimeTypes.pm (original)
+++ trunk/libsvn-hooks-perl/lib/SVN/Hooks/CheckMimeTypes.pm Wed Oct 6 21:15:43 2010
@@ -23,7 +23,7 @@
set.
The plugin was based on the
-L<check-mime-type.pl|http://svn.digium.com/view/repotools/check-mime-type.pl>
+check-mime-type.pl L<http://svn.digium.com/view/repotools/check-mime-type.pl>
script.
It's active in the C<pre-commit> hook.
Modified: trunk/libsvn-hooks-perl/lib/SVN/Hooks/DenyFilenames.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/lib/SVN/Hooks/DenyFilenames.pm?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/lib/SVN/Hooks/DenyFilenames.pm (original)
+++ trunk/libsvn-hooks-perl/lib/SVN/Hooks/DenyFilenames.pm Wed Oct 6 21:15:43 2010
@@ -22,25 +22,52 @@
It's active in the C<pre-commit> hook.
-It's configured by the following directives.
+It's configured by the following directive.
-=head2 DENY_FILENAMES(REGEXP, ...)
+=head2 DENY_FILENAMES(REGEXP, [REGEXP => MESSAGE], ...)
This directive denies the addition of new files matching the Regexps
-passed as arguments.
+passed as arguments. If any file or directory added in the commit
+matches one of the specified Regexps the commit is aborted with an
+error message telling about every denied file.
- DENY_FILENAMES(qr/\.(doc|xls|ppt)$/); # ODF only, please
+The arguments may be compiled Regexps or two-element arrays consisting
+of a compiled Regexp and a specific error message. If a file matches
+one of the lone Regexps an error message like this is produced:
+
+ DENY_FILENAMES: filename not allowed: filename
+
+If a file matches a Regexp associated with an error message, the
+specified error message is substituted for the 'filename not allowed'
+default.
+
+Example:
+
+ DENY_FILENAMES(
+ qr/\.(doc|xls|ppt)$/i, # ODF only, please
+ [qr/\.(exe|zip|jar)/i => 'No binaries, please!'],
+ );
=cut
sub DENY_FILENAMES {
- my @regexes = @_;
- foreach my $regex (@regexes) {
- ref $regex eq 'Regexp'
- or croak "$HOOK: got \"$regex\" while expecting a qr/Regex/.\n";
+ my @checks = @_;
+ my $conf = $SVN::Hooks::Confs->{$HOOK};
+ foreach my $check (@checks) {
+ if (ref $check eq 'Regexp') {
+ push @{$conf->{checks}}, [$check => 'filename not allowed'];
+ } elsif (ref $check eq 'ARRAY') {
+ @$check == 2
+ or croak "$HOOK: array arguments must have two arguments.\n";
+ ref $check->[0] eq 'Regexp'
+ or croak "$HOOK: got \"$check->[0]\" while expecting a qr/Regex/.\n";
+ ! ref $check->[1]
+ or croak "$HOOK: got \"$check->[1]\" while expecting a string.\n";
+ push @{$conf->{checks}}, $check;
+ } else {
+ croak "$HOOK: got \"$check\" while expecting a qr/Regex/ or a [qr/Regex/, 'message'].\n";
+ }
}
- my $conf = $SVN::Hooks::Confs->{$HOOK};
- $conf->{checks} = \@regexes;
$conf->{'pre-commit'} = \&pre_commit;
return 1;
@@ -52,21 +79,18 @@
sub pre_commit {
my ($self, $svnlook) = @_;
- my @denied;
+ my $errors;
ADDED:
foreach my $added ($svnlook->added()) {
- foreach my $regex (@{$self->{checks}}) {
- if ($added =~ $regex) {
- push @denied, $added;
+ foreach my $check (@{$self->{checks}}) {
+ if ($added =~ $check->[0]) {
+ $errors .= "$HOOK: $check->[1]: $added\n";
next ADDED;
}
}
}
- if (@denied) {
- croak join("\n",
- "$HOOK: the files below can't be added because their names aren't allowed:",
- @denied), "\n";
- }
+
+ croak $errors if $errors;
}
=head1 AUTHOR
Modified: trunk/libsvn-hooks-perl/lib/SVN/Hooks/JiraAcceptance.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/lib/SVN/Hooks/JiraAcceptance.pm?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/lib/SVN/Hooks/JiraAcceptance.pm (original)
+++ trunk/libsvn-hooks-perl/lib/SVN/Hooks/JiraAcceptance.pm Wed Oct 6 21:15:43 2010
@@ -21,9 +21,9 @@
This SVN::Hooks plugin is deprecated. Please, consider using the
SVN::Hooks::CheckJira plugin instead.
-This plugin was derived from version 1.3 of the L<JIRA Commit
+This plugin was derived from version 1.3 of the JIRA Commit
Acceptance
-Plugin|http://svn.atlassian.com/svn/public/contrib/jira/jira-commitacceptance-plugin/jars/jira-commitacceptance-plugin-1.3-client-scripts.zip>
+Plugin L<http://svn.atlassian.com/svn/public/contrib/jira/jira-commitacceptance-plugin/jars/jira-commitacceptance-plugin-1.3-client-scripts.zip>
by ferenc.kiss at midori.hu.
When enabled, it requires that any commits affecting some parts of the
Modified: trunk/libsvn-hooks-perl/t/02-denyfilenames.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/t/02-denyfilenames.t?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/t/02-denyfilenames.t (original)
+++ trunk/libsvn-hooks-perl/t/02-denyfilenames.t Wed Oct 6 21:15:43 2010
@@ -8,7 +8,7 @@
require "test-functions.pl";
if (can_svn()) {
- plan tests => 4;
+ plan tests => 5;
}
else {
plan skip_all => 'Cannot find or use svn commands.';
@@ -24,29 +24,35 @@
DENY_FILENAMES('string');
EOS
-work_nok('cant parse config', 'DENY_FILENAMES: got "string" while expecting a qr/Regex/', <<"EOS");
+work_nok('cant parse config', 'DENY_FILENAMES: got "string" while expecting a qr/Regex/ or a', <<"EOS");
touch $t/wc/f
svn add -q --no-auto-props $t/wc/f
svn ci -mx $t/wc/f
EOS
set_conf(<<'EOS');
-DENY_FILENAMES(qr/[^\w]/i, qr/substring/);
+DENY_FILENAMES(qr/[^\w]/i, qr/substring/, [qr/custommessage/ => 'custom message']);
EOS
work_ok('valid', <<"EOS");
svn ci -mx $t/wc/f
EOS
-work_nok('invalid', 'DENY_FILENAMES: the files below can\'t be added because their names aren\'t allowed', <<"EOS");
+work_nok('invalid', 'DENY_FILENAMES: filename not allowed: f', <<"EOS");
touch $t/wc/f,
svn add -q --no-auto-props $t/wc/f,
svn ci -mx $t/wc/f,
EOS
-work_nok('second invalid', 'DENY_FILENAMES: the files below can\'t be added because their names aren\'t allowed', <<"EOS");
+work_nok('second invalid', 'DENY_FILENAMES: filename not allowed: withsubstringinthemiddle', <<"EOS");
touch $t/wc/withsubstringinthemiddle
svn add -q --no-auto-props $t/wc/withsubstringinthemiddle
svn ci -mx $t/wc/withsubstringinthemiddle
EOS
+work_nok('custom message', 'DENY_FILENAMES: custom message: withcustommessage', <<"EOS");
+touch $t/wc/withcustommessage
+svn add -q --no-auto-props $t/wc/withcustommessage
+svn ci -mx $t/wc/withcustommessage
+EOS
+
Modified: trunk/libsvn-hooks-perl/t/02-updateconffile.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsvn-hooks-perl/t/02-updateconffile.t?rev=63445&op=diff
==============================================================================
--- trunk/libsvn-hooks-perl/t/02-updateconffile.t (original)
+++ trunk/libsvn-hooks-perl/t/02-updateconffile.t Wed Oct 6 21:15:43 2010
@@ -125,7 +125,7 @@
cmp $t/wc/generated $t/repo/conf/generate
EOS
-set_conf(<<'EOS');
+my $conf = <<'EOS';
UPDATE_CONF_FILE(subfile => 'subdir');
UPDATE_CONF_FILE(qr/^file(\d)$/ => '$1-file');
@@ -133,7 +133,7 @@
sub actuate {
my ($text, $file) = @_;
die "undefined second argument" unless defined $file;
- open F, '>', "/tmp/actuated" or die $!;
+ open F, '>', "TTT/repo/conf/really-actuated" or die $!;
print F $text;
close F;
}
@@ -141,6 +141,10 @@
UPDATE_CONF_FILE(actuate => 'actuate',
actuator => \&actuate);
EOS
+
+$conf =~ s/TTT/$t/;
+
+set_conf($conf);
mkdir "$t/repo/conf/subdir";
@@ -162,5 +166,5 @@
echo asdf >$t/wc/actuate
svn add -q --no-auto-props $t/wc/actuate
svn ci -mx $t/wc/actuate
-cmp $t/wc/actuate /tmp/actuated
+cmp $t/wc/actuate $t/repo/conf/really-actuated
EOS
More information about the Pkg-perl-cvs-commits
mailing list