[Bps-public-commit] r13605 - in Shipwright/trunk: lib/Shipwright/Backend

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Jun 25 20:17:45 EDT 2008


Author: sunnavy
Date: Wed Jun 25 20:17:45 2008
New Revision: 13605

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright/Backend/SVK.pm
   Shipwright/trunk/lib/Shipwright/Backend/SVN.pm

Log:
 r13811 at sunnavys-mb:  sunnavy | 2008-06-26 07:52:19 +0800
 added ktf backend support


Modified: Shipwright/trunk/lib/Shipwright/Backend/SVK.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Backend/SVK.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Backend/SVK.pm	Wed Jun 25 20:17:45 2008
@@ -698,6 +698,39 @@
     $self->checkout( detach => 1, target => $file );
 }
 
+=item ktf
+
+Get or set known failure conditions.
+
+=cut
+
+sub ktf {
+    my $self    = shift;
+    my $failure = shift;
+
+    if ($failure) {
+        my $dir = tempdir( CLEANUP => 1 );
+        my $file = File::Spec->catfile( $dir, 'ktf.yml' );
+
+        $self->checkout(
+            path   => '/shipwright/ktf.yml',
+            target => $file,
+        );
+
+        Shipwright::Util::DumpFile( $file, $failure );
+        $self->commit(
+            path    => $file,
+            comment => 'set known failure',
+        );
+        $self->checkout( detach => 1, target => $file );
+    }
+    else {
+        my ($out) = Shipwright::Util->run(
+            [ 'svk', 'cat', $self->repository . '/shipwright/ktf.yml' ] );
+        return Shipwright::Util::Load($out) || {};
+    }
+}
+
 =back
 
 =cut

Modified: Shipwright/trunk/lib/Shipwright/Backend/SVN.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Backend/SVN.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Backend/SVN.pm	Wed Jun 25 20:17:45 2008
@@ -700,6 +700,39 @@
     }
 }
 
+=item ktf
+
+Get or set known failure conditions.
+
+=cut
+
+sub ktf {
+    my $self    = shift;
+    my $failure = shift;
+
+    if ($failure) {
+        my $dir = tempdir( CLEANUP => 1 );
+        my $file = File::Spec->catfile( $dir, 'ktf.yml' );
+
+        $self->checkout(
+            path   => '/shipwright',
+            target => $dir,
+        );
+
+        Shipwright::Util::DumpFile( $file, $failure );
+
+        $self->commit(
+            path    => $file,
+            comment => 'set known failure',
+        );
+    }
+    else {
+        my ($out) = Shipwright::Util->run(
+            [ 'svn', 'cat', $self->repository . '/shipwright/ktf.yml' ] );
+        return Shipwright::Util::Load($out) || {};
+    }
+}
+
 =back
 
 =cut



More information about the Bps-public-commit mailing list