[Bps-public-commit] r10222 - bpsbuilder/BPB/lib/BPB/Backend

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Jan 2 10:56:01 EST 2008


Author: sunnavy
Date: Wed Jan  2 10:55:58 2008
New Revision: 10222

Modified:
   bpsbuilder/BPB/lib/BPB/Backend/SVK.pm

Log:
added info method, and delete is improved

Modified: bpsbuilder/BPB/lib/BPB/Backend/SVK.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Backend/SVK.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Backend/SVK.pm	Wed Jan  2 10:55:58 2008
@@ -138,8 +138,12 @@
           $args{path};
     }
     elsif ( $type eq 'delete' ) {
-        $cmd = join ' ', 'svk', 'delete', $self->repository, '-m',
-          q{'} . 'delete repository' . q{'};
+        $cmd = join ' ', 'svk', 'delete', '-m',
+          q{'} . 'delete repository' . q{'}, join '/', $self->repository,
+          $args{path};
+    }
+    elsif ( $type eq 'info' ) {
+        $cmd = join ' ', 'svk', 'info', $self->repository, $args{path};
     }
     else {
         croak "invalid command";
@@ -224,8 +228,18 @@
 
 sub delete {
     my $self = shift;
-    my $cmd  = $self->_cmd('delete');
-    $self->_run($cmd);
+    my $path = shift;
+    $self->_run( $self->_cmd( delete => path => $path ) )
+      if $self->info($path);
+}
+
+sub info {
+    my $self = shift;
+    my $path = shift;
+    my $cmd  = $self->_cmd( info => path => $path );
+    my $info = `$cmd`;
+    return $info unless $info =~ /does not exist/i;
+    return;
 }
 
 1;



More information about the Bps-public-commit mailing list