r65790 - in /branches/upstream/libsvn-hooks-perl/current: Changes META.yml README lib/SVN/Hooks.pm lib/SVN/Hooks/AllowLogChange.pm lib/SVN/Hooks/AllowPropChange.pm lib/SVN/Hooks/CheckCapability.pm lib/SVN/Hooks/Generic.pm t/02-generic.t
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Sun Dec 12 14:44:57 UTC 2010
Author: angelabad-guest
Date: Sun Dec 12 14:44:39 2010
New Revision: 65790
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=65790
Log:
[svn-upgrade] new version libsvn-hooks-perl (0.32)
Modified:
branches/upstream/libsvn-hooks-perl/current/Changes
branches/upstream/libsvn-hooks-perl/current/META.yml
branches/upstream/libsvn-hooks-perl/current/README
branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks.pm
branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/AllowLogChange.pm
branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/AllowPropChange.pm
branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/CheckCapability.pm
branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/Generic.pm
branches/upstream/libsvn-hooks-perl/current/t/02-generic.t
Modified: branches/upstream/libsvn-hooks-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsvn-hooks-perl/current/Changes?rev=65790&op=diff
==============================================================================
--- branches/upstream/libsvn-hooks-perl/current/Changes (original)
+++ branches/upstream/libsvn-hooks-perl/current/Changes Sun Dec 12 14:44:39 2010
@@ -1,4 +1,12 @@
Revision history for SVN-Hooks. -*- text -*-
+
+0.32 2010-12-10
+
+ Corrects some long standing errors in the arguments passed to
+ some hooks.
+
+ Corrects some hard errors in the SVN::Hooks::Generic plugin
+ and enhances its test suite.
0.31 2010-12-09
Modified: branches/upstream/libsvn-hooks-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsvn-hooks-perl/current/META.yml?rev=65790&op=diff
==============================================================================
--- branches/upstream/libsvn-hooks-perl/current/META.yml (original)
+++ branches/upstream/libsvn-hooks-perl/current/META.yml Sun Dec 12 14:44:39 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: SVN-Hooks
-version: 0.31
+version: 0.32
abstract: A framework for implementing Subversion hooks.
author:
- Gustavo Chaves <gnustavo at cpan.org>
Modified: branches/upstream/libsvn-hooks-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsvn-hooks-perl/current/README?rev=65790&op=diff
==============================================================================
--- branches/upstream/libsvn-hooks-perl/current/README (original)
+++ branches/upstream/libsvn-hooks-perl/current/README Sun Dec 12 14:44:39 2010
@@ -1,6 +1,6 @@
Name: SVN-Hooks
What: Framework for Subversion hooks
-Version: 0.31
+Version: 0.32
Author: Gustavo Chaves <gnustavo at cpan.org>
SVN-Hooks is a framework for creating Subversion hooks
Modified: branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks.pm?rev=65790&op=diff
==============================================================================
--- branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks.pm (original)
+++ branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks.pm Sun Dec 12 14:44:39 2010
@@ -15,11 +15,11 @@
=head1 VERSION
-Version 0.31
+Version 0.32
=cut
-our $VERSION = '0.31';
+our $VERSION = '0.32';
=head1 SYNOPSIS
@@ -331,20 +331,20 @@
# in the hooks where this makes sense.
if ($hook_name eq 'pre-commit') {
# The next arg is a transaction number
- $args[0] = SVN::Look->new($repo_path, '-t' => $args[0]);
+ $repo_path = SVN::Look->new($repo_path, '-t' => $args[0]);
}
elsif ($hook_name =~ /^(?:post-commit|(?:pre|post)-revprop-change)$/) {
# The next arg is a revision number
- $args[0] = SVN::Look->new($repo_path, '-r' => $args[0]);
+ $repo_path = SVN::Look->new($repo_path, '-r' => $args[0]);
}
foreach my $conf (values %{$repo->{confs}}) {
if (my $hook = $conf->{$hook_name}) {
if (ref $hook eq 'CODE') {
- $hook->($conf, @args);
+ $hook->($conf, $repo_path, @args);
} elsif (ref $hook eq 'ARRAY') {
foreach my $h (@$hook) {
- $h->($conf, @args);
+ $h->($conf, $repo_path, @args);
}
} else {
die "SVN::Hooks: internal error!\n";
Modified: branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/AllowLogChange.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/AllowLogChange.pm?rev=65790&op=diff
==============================================================================
--- branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/AllowLogChange.pm (original)
+++ branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/AllowLogChange.pm Sun Dec 12 14:44:39 2010
@@ -79,7 +79,7 @@
};
sub pre_revprop_change {
- my ($self, $rev, $author, $propname, $action) = @_;
+ my ($self, $svnlook, $rev, $author, $propname, $action) = @_;
$propname eq 'svn:log'
or croak "$HOOK: the revision property $propname cannot be changed.\n";
Modified: branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/AllowPropChange.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/AllowPropChange.pm?rev=65790&op=diff
==============================================================================
--- branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/AllowPropChange.pm (original)
+++ branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/AllowPropChange.pm Sun Dec 12 14:44:39 2010
@@ -100,7 +100,7 @@
};
sub pre_revprop_change {
- my ($self, $rev, $author, $propname, $action) = @_;
+ my ($self, $svnlook, $rev, $author, $propname, $action) = @_;
$propname =~ /^svn:(?:author|date|log)$/
or croak "$HOOK: the revision property $propname cannot be changed.\n";
Modified: branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/CheckCapability.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/CheckCapability.pm?rev=65790&op=diff
==============================================================================
--- branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/CheckCapability.pm (original)
+++ branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/CheckCapability.pm Sun Dec 12 14:44:39 2010
@@ -53,7 +53,7 @@
};
sub start_commit {
- my ($self, $user, $capabilities) = @_;
+ my ($self, $repo_path, $user, $capabilities) = @_;
$capabilities ||= ''; # pre 1.5 svn clients don't pass the capabilities
Modified: branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/Generic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/Generic.pm?rev=65790&op=diff
==============================================================================
--- branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/Generic.pm (original)
+++ branches/upstream/libsvn-hooks-perl/current/lib/SVN/Hooks/Generic.pm Sun Dec 12 14:44:39 2010
@@ -43,21 +43,21 @@
=item post-commit(SVN::Look)
-=item post-lock(repository-path, username)
+=item post-lock(repos-path, username)
=item post-revprop-change(SVN::Look, username, property-name, action)
-=item post-unlock(repository-path, username)
+=item post-unlock(repos-path, username)
=item pre-commit(SVN::Look)
-=item pre-lock(repository-path, username, comment, steal-lock-flag)
+=item pre-lock(repos-path, path, username, comment, steal-lock-flag)
=item pre-revprop-change(SVN::Look, username, property-name, action)
-=item pre-unlock(repository-path, username, lock-token, break-unlock-flag)
+=item pre-unlock(repos-path, path, username, lock-token, break-unlock-flag)
-=item start-commit(repository-path, username, capabilities)
+=item start-commit(repos-path, username, capabilities)
=back
@@ -69,13 +69,13 @@
The sketch below shows how this directive could be used.
sub my_start_commit {
- my ($repo, $username, $capabilities) = @_;
- // ...
+ my ($repo_path, $username, $capabilities) = @_;
+ # ...
}
sub my_pre_commit {
my ($svnlook) = @_;
- // ...
+ # ...
}
GENERIC(
@@ -108,7 +108,7 @@
foreach my $foo (@$functions) {
ref $foo and ref $foo eq 'CODE'
or die "$HOOK: hook '$hook' should be mapped to CODE-refs.\n";
- push @{$conf->{$hook}}, $foo;
+ push @{$conf->{$hook}}, sub { shift; $foo->(@_); };
}
}
Modified: branches/upstream/libsvn-hooks-perl/current/t/02-generic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsvn-hooks-perl/current/t/02-generic.t?rev=65790&op=diff
==============================================================================
--- branches/upstream/libsvn-hooks-perl/current/t/02-generic.t (original)
+++ branches/upstream/libsvn-hooks-perl/current/t/02-generic.t Sun Dec 12 14:44:39 2010
@@ -8,7 +8,7 @@
require "test-functions.pl";
if (can_svn()) {
- plan tests => 7;
+ plan tests => 12;
}
else {
plan skip_all => 'Cannot find or use svn commands.';
@@ -78,3 +78,54 @@
svn ci -mx $t/wc/file.txt
EOS
+set_conf(<<'EOS');
+GENERIC(
+ 'start-commit' => sub { die join(',', at _), "\n"; },
+);
+EOS
+
+work_nok('cry start-commit' => "$t/repo,", <<"EOS");
+echo asdf >>$t/wc/file.txt
+svn ci -mx $t/wc/file.txt
+EOS
+
+set_conf(<<'EOS');
+GENERIC(
+ 'pre-commit' => sub { die join(',', at _), "\n"; },
+);
+EOS
+
+work_nok('cry pre-commit' => 'SVN::Look=HASH', <<"EOS");
+svn ci -mx $t/wc/file.txt
+EOS
+
+set_conf(<<'EOS');
+GENERIC(
+ 'pre-revprop-change' => sub { die join(',', at _), "\n"; },
+);
+EOS
+
+work_nok('cry pre-revprop-change' => 'SVN::Look=HASH', <<"EOS");
+svn ps svn:log --revprop -r 1 'changed' $t/wc
+EOS
+
+set_conf(<<'EOS');
+GENERIC(
+ 'pre-lock' => sub { die join(',', at _), "\n"; },
+);
+EOS
+
+work_nok('cry pre-lock' => "$t/repo,/file.txt,", <<"EOS");
+svn lock -mx $t/wc/file.txt
+EOS
+
+set_conf(<<'EOS');
+GENERIC(
+ 'pre-unlock' => sub { die join(',', at _), "\n"; },
+);
+EOS
+
+work_nok('cry pre-unlock' => "$t/repo,/file.txt,", <<"EOS");
+svn lock $t/wc/file.txt
+svn unlock $t/wc/file.txt
+EOS
More information about the Pkg-perl-cvs-commits
mailing list