[Bps-public-commit] r17792 - in Shipwright/trunk: lib/Shipwright/Script

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Jan 16 11:52:11 EST 2009


Author: sunnavy
Date: Fri Jan 16 11:52:10 2009
New Revision: 17792

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright/Script/Rename.pm

Log:
 r18836 at sunnavys-mb:  sunnavy | 2009-01-16 23:31:02 +0800
 update branches when rename


Modified: Shipwright/trunk/lib/Shipwright/Script/Rename.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Rename.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Rename.pm	Fri Jan 16 11:52:10 2009
@@ -46,13 +46,14 @@
     }
     $shipwright->backend->map($map);
 
-    # update version.yml, source.yml and flags.yml
-    my $version = $shipwright->backend->version || {};
-    my $source  = $shipwright->backend->source  || {};
-    my $flags   = $shipwright->backend->flags   || {};
-    my $refs    = $shipwright->backend->refs    || {};
+    my $version = $shipwright->backend->version;
+    my $source  = $shipwright->backend->source;
+    my $flags   = $shipwright->backend->flags;
+    my $refs    = $shipwright->backend->refs;
+    my $branches= $shipwright->backend->branches;
 
-    for my $hashref ( $source, $flags, $version, $refs ) {
+    for my $hashref ( $source, $flags, $version, $refs, $branches ) {
+        next unless $hashref; # branches can be undef
         for ( keys %$hashref ) {
             if ( $_ eq $name ) {
                 $hashref->{$new_name} = delete $hashref->{$_};
@@ -65,6 +66,7 @@
     $shipwright->backend->source($source);
     $shipwright->backend->flags($flags);
     $shipwright->backend->refs($refs);
+    $shipwright->backend->branches($branches) if $branches;
 
     print "renamed $name to $new_name with success\n";
 }



More information about the Bps-public-commit mailing list