[Bps-public-commit] r14284 - in Pushmi/trunk: lib/Pushmi

clkao at bestpractical.com clkao at bestpractical.com
Fri Jul 18 16:10:02 EDT 2008


Author: clkao
Date: Fri Jul 18 16:09:10 2008
New Revision: 14284

Modified:
   Pushmi/trunk/lib/Pushmi/Test.pm
   Pushmi/trunk/t/basic.t

Log:
test compatibility for svn 1.4.


Modified: Pushmi/trunk/lib/Pushmi/Test.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Test.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Test.pm	Fri Jul 18 16:09:10 2008
@@ -51,7 +51,9 @@
     my ($arg, $exp_stdout, $exp_stderr) = @_;
     my $stdout_err = [];
     $exp_stderr ||= [];
-    my $ret = run3 ['svn', @$arg], undef,
+    my $ret = run3 ['svn', ($SVN::Core::VERSION ge '1.5.0'
+                            ? '--non-interactive' : ()),
+                    @$arg], undef,
 	_mk_cmp_closure($exp_stdout, $stdout_err), # stdout
 	_mk_cmp_closure($exp_stderr, $stdout_err); # stderr
     if (@$stdout_err) {

Modified: Pushmi/trunk/t/basic.t
==============================================================================
--- Pushmi/trunk/t/basic.t	(original)
+++ Pushmi/trunk/t/basic.t	Fri Jul 18 16:09:10 2008
@@ -79,26 +79,31 @@
 
 sub svn_error_txn_outofdate {
     my ($file, $txn) = @_;
-    # XXX: older svn:
-    #	       "Out of date: '$file' in transaction '$txn'";
+
+    my $rel_file = substr($file, 1);
+    return ("Out of date: '$rel_file' in transaction '$txn'")
+        if $SVN::Core::VERSION lt '1.5.0';
+
     return "File '$file' is out of date";
 }
 
 sub svn_error_commit_hook {
     my ($exit_code, $file, $txn) = @_;
 
+    my $rel_file = substr($file, 1);
+    return ("svn: 'pre-commit' hook failed with error output:",
+            "Out of date: '$rel_file' in transaction '$txn'")
+        if $SVN::Core::VERSION lt '1.5.0';
+
     return ("svn: Commit blocked by pre-commit hook (exit code $exit_code) with output:",
             svn_error_txn_outofdate($file, $txn));
-
-	       qr{svn: 'pre-commit' hook failed.*:},
-	       q{Out of date: 'fromsvn.txt' in transaction '5-1'}
 }
 
 is_svn_output(['ci', -m => 'trying to commit outdated change from svn'],
 	      ['Sending        fromsvn.txt',
 	       'Transmitting file data .'],
 	      ['svn: Commit failed (details follow):',
-               svn_error_commit_hook(255, '/fromsvn.txt'),
+               svn_error_commit_hook(255, '/fromsvn.txt', '5-1'),
                '']);
 
 is($srepos->fs->youngest_rev, 5, "svn didn't commit through");



More information about the Bps-public-commit mailing list