[Bps-public-commit] r14124 - Pushmi/trunk/t

clkao at bestpractical.com clkao at bestpractical.com
Tue Jul 15 13:34:54 EDT 2008


Author: clkao
Date: Tue Jul 15 13:34:45 2008
New Revision: 14124

Modified:
   Pushmi/trunk/t/auth.t
   Pushmi/trunk/t/basic.t

Log:
tweak error output expectation from newer svn.


Modified: Pushmi/trunk/t/auth.t
==============================================================================
--- Pushmi/trunk/t/auth.t	(original)
+++ Pushmi/trunk/t/auth.t	Tue Jul 15 13:34:45 2008
@@ -93,11 +93,21 @@
 is_svn_output(['add', "$copath/fileA.txt"],
 	      ['A         t/checkout/auth-svn/fileA.txt']);
 
+sub svn_error_authz_failure {
+    my ($url, $path) = @_;
+
+    # XXX: older svn error message:
+#	       "svn: OPTIONS request failed on '/svn/X'",
+#	       "svn: OPTIONS of '/svn/X': authorization failed (http://localhost:$perlbal_port)"]);
+
+    return "svn: OPTIONS of '$url$path': authorization failed ($url)";
+}
+
 is_svn_output(['ci', '--non-interactive', '--no-auth-cache', '--username' => 'test', '--password' => '', -m => 'commit a single file', $copath],
 	      [],
 	      ["svn: Commit failed (details follow):",
-	       "svn: OPTIONS request failed on '/svn/X'",
-	       "svn: OPTIONS of '/svn/X': authorization failed (http://localhost:$perlbal_port)"]);
+               svn_error_authz_failure("http://localhost:$perlbal_port", '/svn/X')
+               ]);
 
 is_svn_output(['ci', '--non-interactive', '--no-auth-cache', '--username' => 'test', '--password' => 'test', -m => 'commit a single file', $copath],
 	      ['Adding         t/checkout/auth-svn/fileA.txt',

Modified: Pushmi/trunk/t/basic.t
==============================================================================
--- Pushmi/trunk/t/basic.t	(original)
+++ Pushmi/trunk/t/basic.t	Tue Jul 15 13:34:45 2008
@@ -76,12 +76,30 @@
 ## svn: Out of date: 'a.txt' in transaction '2-1'
 is($repos->fs->youngest_rev, 4, "svn didn't commit through");
 append_file("fromsvn.txt", "to conflict\n");
+
+sub svn_error_txn_outofdate {
+    my ($file, $txn) = @_;
+    # XXX: older svn:
+    #	       "Out of date: '$file' in transaction '$txn'";
+    return "File '$file' is out of date";
+}
+
+sub svn_error_commit_hook {
+    my ($exit_code, $file, $txn) = @_;
+
+    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):',
-	       qr{svn: 'pre-commit' hook failed.*:},
-	       q{Out of date: 'fromsvn.txt' in transaction '5-1'}, '']);
+               svn_error_commit_hook(255, '/fromsvn.txt'),
+               '']);
 
 is($srepos->fs->youngest_rev, 5, "svn didn't commit through");
 is($repos->fs->youngest_rev, 5, "svn didn't commit through, but updates mirror");
@@ -89,7 +107,7 @@
 is_svn_output(['ci', -m => 'trying to commit outdated change from svn'],
 	      ['Sending        fromsvn.txt'],
 	      ['svn: Commit failed (details follow):',
-	       q{svn: Out of date: 'fromsvn.txt' in transaction '5-1'}]);
+	       'svn: '.svn_error_txn_outofdate('/fromsvn.txt', '5-1')]);
 
 is_svn_output(['up'],
 	      ['C    fromsvn.txt',



More information about the Bps-public-commit mailing list