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

sartak at bestpractical.com sartak at bestpractical.com
Thu Jul 17 22:38:01 EDT 2008


Author: sartak
Date: Thu Jul 17 22:38:00 2008
New Revision: 14244

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

Log:
 r64537 at onn:  sartak | 2008-07-17 22:31:37 -0400
 Have the pull and push commands use the merge command better


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	Thu Jul 17 22:38:00 2008
@@ -2,17 +2,16 @@
 use Moose;
 extends 'Prophet::CLI::Command::Merge';
 
-sub run {
+override run => sub {
+    my $self = shift;
 
-    my $self         = shift;
-    my $other        = $self->arg('from');
-    my $source_other = Prophet::Replica->new( { url => $other } );
-    $self->app_handle->handle->import_resolutions_from_remote_replica(
-        from => $source_other );
+    die "Please specify a --from.\n" if !$self->has_arg('from');
 
-    $self->_do_merge( $source_other, $self->app_handle->handle );
+    $self->set_arg(to => $self->cli->app_handle->default_replica_type.":file://"
+.$self->cli->app_handle->handle->fs_root);
 
-}
+    super();
+};
 
 __PACKAGE__->meta->make_immutable;
 no Moose;

Modified: Prophet/trunk/lib/Prophet/CLI/Command/Push.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command/Push.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/Command/Push.pm	Thu Jul 17 22:38:00 2008
@@ -2,17 +2,16 @@
 use Moose;
 extends 'Prophet::CLI::Command::Merge';
 
-sub run {
+override run => sub {
     my $self = shift;
 
-    my $source_me    = $self->app_handle->handle;
-    my $other        = $self->arg('to');
-    my $source_other = Prophet::Replica->new( { url => $other } );
-    my $resdb        = $source_me->import_resolutions_from_remote_replica(
-        from => $source_other );
+    die "Please specify a --to.\n" if !$self->has_arg('to');
 
-    $self->_do_merge( $source_me, $source_other );
-}
+    $self->set_arg(from => $self->app_handle->default_replica_type.":file://".$s
+elf->app_handle->handle->fs_root);
+
+    super();
+};
 
 __PACKAGE__->meta->make_immutable;
 no Moose;



More information about the Bps-public-commit mailing list