[Bps-public-commit] r14987 - in Shipwright/branches/2.0: lib/Shipwright/Backend

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Aug 11 06:01:52 EDT 2008


Author: sunnavy
Date: Mon Aug 11 06:01:51 2008
New Revision: 14987

Modified:
   Shipwright/branches/2.0/   (props changed)
   Shipwright/branches/2.0/lib/Shipwright/Backend/Base.pm
   Shipwright/branches/2.0/lib/Shipwright/Backend/FS.pm
   Shipwright/branches/2.0/lib/Shipwright/Backend/SVK.pm
   Shipwright/branches/2.0/lib/Shipwright/Backend/SVN.pm

Log:
 r15454 at sunnavys-mb:  sunnavy | 2008-08-11 15:39:57 +0800
 abstract if the repo has branch support


Modified: Shipwright/branches/2.0/lib/Shipwright/Backend/Base.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Backend/Base.pm	(original)
+++ Shipwright/branches/2.0/lib/Shipwright/Backend/Base.pm	Mon Aug 11 06:01:51 2008
@@ -648,7 +648,7 @@
 }
 
 
-*_cmd = *_update_file = *_subclass_method;
+*_cmd = *_update_file = *_subclass_method = *has_branch_support;
 
 
 =back

Modified: Shipwright/branches/2.0/lib/Shipwright/Backend/FS.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Backend/FS.pm	(original)
+++ Shipwright/branches/2.0/lib/Shipwright/Backend/FS.pm	Mon Aug 11 06:01:51 2008
@@ -71,7 +71,7 @@
                 ];
             }
             else {
-                if ( -e $self->repository . '/sources/' ) {
+                if ( $self->has_branch_support ) {
                     unless ( -e $self->repository . "/sources/$args{name}/" ) {
                         push @cmd,
                           [
@@ -181,6 +181,19 @@
     copy( $latest, $file );
 }
 
+=item has_branch_support
+
+return true if has branch support 
+
+=cut
+
+sub has_branch_support {
+    my $self = shift;
+    my $out = $self->info( path => '/' );
+    return 1 if $out =~ /sources/;
+    return;
+}
+
 =back
 
 =cut

Modified: Shipwright/branches/2.0/lib/Shipwright/Backend/SVK.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Backend/SVK.pm	(original)
+++ Shipwright/branches/2.0/lib/Shipwright/Backend/SVK.pm	Mon Aug 11 06:01:51 2008
@@ -100,7 +100,7 @@
                 ];
             }
             else {
-                if ( $self->info( path => '/sources' ) ) {
+                if ( $self->has_branch_support ) {
                     @cmd = [
                         'svk',
                         'import',
@@ -257,6 +257,18 @@
     $self->checkout( detach => 1, target => $file );
 }
 
+=item has_branch_support
+
+return true if has branch support 
+
+=cut
+
+sub has_branch_support {
+    my $self = shift;
+    return 1 if $self->info( path => '/sources' );
+    return;
+}
+
 =back
 
 =cut

Modified: Shipwright/branches/2.0/lib/Shipwright/Backend/SVN.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Backend/SVN.pm	(original)
+++ Shipwright/branches/2.0/lib/Shipwright/Backend/SVN.pm	Mon Aug 11 06:01:51 2008
@@ -99,8 +99,7 @@
                 ];
             }
             else {
-                if ( $self->info( path => '/sources' ) ) {
-
+                if ( $self->has_branch_support ) {
                     @cmd = [
                         'svn',
                         'import',
@@ -260,6 +259,18 @@
     }
 }
 
+=item has_branch_support
+
+return true if has branch support 
+
+=cut
+
+sub has_branch_support {
+    my $self = shift;
+    return 1 if $self->info( path => '/sources' );
+    return;
+}
+
 =back
 
 =cut



More information about the Bps-public-commit mailing list