[Bps-public-commit] r14800 - in Prophet/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Tue Aug 5 15:37:41 EDT 2008


Author: sartak
Date: Tue Aug  5 15:37:39 2008
New Revision: 14800

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/CLI/Command/Pull.pm

Log:
 r54103 at gorgoroth:  sartak | 2008-08-05 15:37:28 -0400
 When we fail to pull from somewhere, don't add it to the --all list


Modified: Prophet/trunk/lib/Prophet/CLI/Command/Pull.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command/Pull.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/Command/Pull.pm	Tue Aug  5 15:37:39 2008
@@ -4,25 +4,17 @@
 
 override run => sub {
     my $self  = shift;
-
     my @from;
-    my %replicas = $self->_read_cached_upstream_replicas;
-    if ($self->has_arg('from')) { 
-        my $from = $self->arg('from');
-        push @from, $from;
-        unless (exists $replicas{$from}) {
-            $replicas{$from} = 1;
-            $self->_write_cached_upstream_replicas(%replicas);
-        }
-    }
 
-    if ($self->has_arg('all')) {
-        push @from, keys %replicas;
-    }
+    my $from = $self->arg('from');
+    push @from, $from if $from;
 
-    die "Please specify a --from.\n" unless @from;
+    my %replicas = $self->_read_cached_upstream_replicas;
+    push @from, keys %replicas
+        if $self->has_arg('all');
+
+    die "Please specify a --from, or --all.\n" if @from == 0;
 
-    
     $self->set_arg(to => $self->cli->app_handle->default_replica_type.":file://".$self->cli->app_handle->handle->fs_root);
     $self->set_arg(db_uuid => $self->app_handle->handle->db_uuid);
 
@@ -31,6 +23,11 @@
             $self->set_arg(from => $from);
             super();
     }
+
+    if ($from && !exists $replicas{$from}) {
+        $replicas{$from} = 1;
+        $self->_write_cached_upstream_replicas(%replicas);
+    }
 };
 
 sub _read_cached_upstream_replicas {



More information about the Bps-public-commit mailing list