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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Jun 27 22:27:21 EDT 2008


Author: sunnavy
Date: Fri Jun 27 22:27:21 2008
New Revision: 13669

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

Log:
 r13918 at sunnavys-mb:  sunnavy | 2008-06-28 09:10:22 +0800
 refacotr update a bit


Modified: Shipwright/trunk/lib/Shipwright/Backend/Base.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Backend/Base.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Backend/Base.pm	Fri Jun 27 22:27:21 2008
@@ -497,11 +497,12 @@
 
     $args{path} = '/' . $args{path} unless $args{path} =~ m{^/};
 
-    return File::Spec->catfile( Shipwright::Util->share_root, $args{path} ),;
+    return $self->_update_file( $args{path},
+        File::Spec->catfile( Shipwright::Util->share_root, $args{path} ) );
 }
 
-#*_cmd = *update = *test_script = *propset = *_subclass_method;
-*_cmd = *update = *_subclass_method;
+#*_cmd = *test_script = *propset = *_subclass_method;
+*_cmd = *_update_file = *_subclass_method;
 
 =back
 

Modified: Shipwright/trunk/lib/Shipwright/Backend/FS.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Backend/FS.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Backend/FS.pm	Fri Jun 27 22:27:21 2008
@@ -167,19 +167,12 @@
     return $self->SUPER::check_repository(@_);
 }
 
-=item update
-
-Update shipwright's own files, e.g. bin/shipwright-builder.
-
-=cut
-
-sub update {
+sub _update_file {
     my $self   = shift;
-    my %args   = @_;
-    my $latest = $self->SUPER::update(@_);
+    my $path   = shift;
+    my $latest = shift;
 
-    my $file =
-      File::Spec->catfile( $self->repository, 'shipwright', $args{path} );
+    my $file = File::Spec->catfile( $self->repository, $path );
 
     copy( $latest, $file );
 }

Modified: Shipwright/trunk/lib/Shipwright/Backend/SVK.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Backend/SVK.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Backend/SVK.pm	Fri Jun 27 22:27:21 2008
@@ -268,29 +268,23 @@
     return;
 }
 
-=item update
-
-Update shipwright's own files, e.g. bin/shipwright-builder.
-
-=cut
-
-sub update {
+sub _update_file {
     my $self   = shift;
-    my %args   = @_;
-    my $latest = $self->SUPER::update(@_);
+    my $path   = shift;
+    my $latest = shift;
 
     my $dir = tempdir( CLEANUP => 1 );
-    my $file = File::Spec->catfile( $dir, $args{path} );
+    my $file = File::Spec->catfile( $dir, $path );
 
     $self->checkout(
-        path   => $args{path},
+        path   => $path,
         target => $file,
     );
 
     copy( $latest, $file );
     $self->commit(
         path    => $file,
-        comment => "update $args{path}",
+        comment => "updated $path",
     );
     $self->checkout( detach => 1, target => $file );
 }

Modified: Shipwright/trunk/lib/Shipwright/Backend/SVN.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Backend/SVN.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Backend/SVN.pm	Fri Jun 27 22:27:21 2008
@@ -278,20 +278,14 @@
     return;
 }
 
-=item update
-
-Update shipwright's own files, e.g. bin/shipwright-builder.
-
-=cut
-
-sub update {
+sub _update_file {
     my $self   = shift;
-    my %args   = @_;
-    my $latest = $self->SUPER::update(@_);
+    my $path   = shift;
+    my $latest = shift;
 
-    if ( $args{path} =~ m{(.*)/} ) {
+    if ( $path =~ m{(.*)/} ) {
         my $dir = tempdir( CLEANUP => 1 );
-        my $file = File::Spec->catfile( $dir, $args{path} );
+        my $file = File::Spec->catfile( $dir, $path );
 
         $self->checkout(
             path   => $1,
@@ -301,7 +295,7 @@
         copy( $latest, $file );
         $self->commit(
             path    => $file,
-            comment => "update $args{path}",
+            comment => "updated $path",
         );
     }
 }



More information about the Bps-public-commit mailing list