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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sun Aug 3 02:59:01 EDT 2008


Author: sunnavy
Date: Sun Aug  3 02:58:59 2008
New Revision: 14731

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

Log:
 r15232 at sunnavys-mb:  sunnavy | 2008-08-03 11:59:53 +0800
 update rename cmd: we should update refs.yml too


Modified: Shipwright/trunk/lib/Shipwright/Script/Rename.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Rename.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Rename.pm	Sun Aug  3 02:58:59 2008
@@ -15,15 +15,13 @@
 
     my ( $name, $new_name ) = @_;
 
-    die "need name arg\n" unless $name;
+    die "need name arg\n"     unless $name;
     die "need new-name arg\n" unless $new_name;
 
     die "invalid new-name: $new_name, should only contain - and alphanumeric\n"
       unless $new_name =~ /^[-\w]+$/;
 
-    my $shipwright = Shipwright->new(
-        repository => $self->repository,
-    );
+    my $shipwright = Shipwright->new( repository => $self->repository, );
 
     my $order = $shipwright->backend->order;
 
@@ -53,8 +51,9 @@
     my $version = $shipwright->backend->version || {};
     my $source  = $shipwright->backend->source  || {};
     my $flags   = $shipwright->backend->flags   || {};
+    my $refs    = $shipwright->backend->refs    || {};
 
-    for my $hashref ( $source, $flags, $version ) {
+    for my $hashref ( $source, $flags, $version, $refs ) {
         for ( keys %$hashref ) {
             if ( $_ eq $name ) {
                 $hashref->{$new_name} = delete $hashref->{$_};
@@ -66,6 +65,7 @@
     $shipwright->backend->version($version);
     $shipwright->backend->source($source);
     $shipwright->backend->flags($flags);
+    $shipwright->backend->refs($refs);
 
     print "renamed $name to $new_name with success\n";
 }



More information about the Bps-public-commit mailing list