[Bps-public-commit] r9033 - in SVN-Hook: t

clkao at bestpractical.com clkao at bestpractical.com
Thu Sep 13 09:12:22 EDT 2007


Author: clkao
Date: Thu Sep 13 09:12:22 2007
New Revision: 9033

Modified:
   SVN-Hook/lib/SVN/Hook/Redispatch.pm
   SVN-Hook/t/02partial.t

Log:
more tests for partial.

Modified: SVN-Hook/lib/SVN/Hook/Redispatch.pm
==============================================================================
--- SVN-Hook/lib/SVN/Hook/Redispatch.pm	(original)
+++ SVN-Hook/lib/SVN/Hook/Redispatch.pm	Thu Sep 13 09:12:22 2007
@@ -30,7 +30,7 @@
 	next unless $_ eq $toplevel || $_->subsumes($toplevel);
 	my @scripts = SVN::Hook::Script->load_from_dir
 	    ( $hook_base.'/'.$spec->{$_} );
-	SVN::Hook->run_scripts( \@scripts );
+	SVN::Hook->run_scripts( \@scripts, 0, @_ );
     }
 
 };

Modified: SVN-Hook/t/02partial.t
==============================================================================
--- SVN-Hook/t/02partial.t	(original)
+++ SVN-Hook/t/02partial.t	Thu Sep 13 09:12:22 2007
@@ -19,12 +19,12 @@
 
 my $tmpdir = tempdir( CLEANUP => 1 );
 
-SVN::Hook->_install_perl_hook($hook->hook_path('_pre-commit/partial'), <<"EOF");
+SVN::Hook->_install_perl_hook($hook->hook_path('_pre-commit/partial'), <<'EOF');
 use SVN::Hook::Redispatch {
-  foo => 'foo_scripts',
+  'foo'     => 'foo_scripts',
   'foo/bar' => 'foobar_scripts',
-  bar => 'bar_scripts',
-}, \@ARGV;
+  'bar'     => 'bar_scripts',
+}, @ARGV;
 exit 0;
 EOF
 
@@ -34,6 +34,12 @@
 EOF
 
 mkpath [$hook->hook_path('_pre-commit/foo_scripts')];
+
+SVN::Hook->_install_perl_hook($hook->hook_path('_pre-commit/foo_scripts/00worky_log'), <<"EOF");
+open my \$fh, '>>', "$tmpdir/worky";
+print \$fh "this is foo worky \$ARGV[1]\\n";
+EOF
+
 SVN::Hook->_install_perl_hook($hook->hook_path('_pre-commit/foo_scripts/die'), <<"EOF");
 die "this is foo die";
 EOF
@@ -47,4 +53,5 @@
 
 is_file_content("$tmpdir/worky", 'this is worky 0-1
 this is worky 1-1
+this is foo worky 1-1
 ');



More information about the Bps-public-commit mailing list