[Bps-public-commit] Prophet branch, master, updated. 0.73-38-g4cd2452
spang at bestpractical.com
spang at bestpractical.com
Sat Jan 9 16:19:15 EST 2010
The branch, master has been updated
via 4cd2452c2b2a403598ffce3f18db944978a5990c (commit)
via 3aa0f782ee5b93ab0ea0ad416bbd27b8200660f1 (commit)
from 5f3f5d48534b5ec8afd79ac3c51ff29b547b3805 (commit)
Summary of changes:
lib/Prophet/CLI/Command/Push.pm | 3 +++
t/error.t | 10 +++++++++-
2 files changed, 12 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit 3aa0f782ee5b93ab0ea0ad416bbd27b8200660f1
Author: Christine Spang <spang at mit.edu>
Date: Sat Jan 9 16:00:51 2010 -0500
don't allow pushing to http replicas
Print a nice message telling the user that they're probably looking
for the publish command instead.
diff --git a/lib/Prophet/CLI/Command/Push.pm b/lib/Prophet/CLI/Command/Push.pm
index 892680d..35a532a 100644
--- a/lib/Prophet/CLI/Command/Push.pm
+++ b/lib/Prophet/CLI/Command/Push.pm
@@ -48,6 +48,9 @@ sub run {
die "No replica found at '".$self->arg('to')."'.\n" unless $class;
+ die "Can't push to HTTP replicas! You probably want to publish instead.\n"
+ if $class->isa("Prophet::Replica::http");
+
die "Can't push to foreign replica that's never been pulled from! (Override with --force.)\n"
unless
$class->isa('Prophet::ForeignReplica') &&
commit 4cd2452c2b2a403598ffce3f18db944978a5990c
Author: Christine Spang <spang at mit.edu>
Date: Sat Jan 9 16:19:05 2010 -0500
Test case for previous change
diff --git a/t/error.t b/t/error.t
index 2e18fd6..aa00676 100644
--- a/t/error.t
+++ b/t/error.t
@@ -2,7 +2,7 @@
use warnings;
use strict;
-use Prophet::Test tests => 1;
+use Prophet::Test tests => 2;
use File::Temp qw(tempdir);
$ENV{'PROPHET_REPO'} = tempdir( CLEANUP => ! $ENV{PROPHET_DEBUG} ) . '/repo-' . $$;
@@ -19,6 +19,14 @@ my @cmds = (
],
comment => 'push to nonexistant replica',
},
+ {
+ cmd => [ 'push', '--to', 'http://foo.com/bar' ],
+ error => [
+ "Can't push to HTTP replicas! You probably want to publish"
+ ." instead.",
+ ],
+ comment => 'push to HTTP replica',
+ },
);
for my $item ( @cmds ) {
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list