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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Aug 11 06:04:30 EDT 2008


Author: sunnavy
Date: Mon Aug 11 06:04:21 2008
New Revision: 14994

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

Log:
 r15461 at sunnavys-mb:  sunnavy | 2008-08-11 17:53:46 +0800
 set branch when import


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:04:21 2008
@@ -131,6 +131,15 @@
                 $version->{$name} = $args{version};
                 $self->version($version);
 
+                my $branches = $self->branches;
+                unless ( $branches->{$name} && grep { $args{as} eq $_ }
+                    @{ $branches->{$name} } )
+                {
+                    $branches->{$name} =
+                      [ @{$branches->{$name} || [] }, $args{as} ];
+                    $self->branches($branches);
+                }
+
                 for my $cmd ( $self->_cmd( import => %args, name => $name ) ) {
                     Shipwright::Util->run($cmd);
                 }
@@ -355,6 +364,20 @@
     return $self->_yml( $path, $version );
 }
 
+=item branches
+
+Get or set branches.
+
+=cut
+
+sub branches {
+    my $self    = shift;
+    my $branches = shift;
+
+    my $path = '/shipwright/branches.yml';
+    return $self->_yml( $path, $branches );
+}
+
 =item ktf
 
 Get or set known failure conditions.



More information about the Bps-public-commit mailing list