[Bps-public-commit] Prophet - A disconnected, replicated p2p database branch, master, updated. 0e38b8b8ba288ea2f32233bcbae2711ac6ae6c7e

spang at bestpractical.com spang at bestpractical.com
Tue Jan 20 17:19:45 EST 2009


The branch, master has been updated
       via  0e38b8b8ba288ea2f32233bcbae2711ac6ae6c7e (commit)
       via  431b5b023924aa2dae2629d269cd681905fe19ed (commit)
      from  0a2a0b97fe1467fb218eff322cc1bbc05c2f7876 (commit)

Summary of changes:
 lib/Prophet/CLI/Command/Update.pm |    4 ++--
 lib/Prophet/CLI/Dispatcher.pm     |   13 ++++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 431b5b023924aa2dae2629d269cd681905fe19ed
Author: Christine Spang <spang at bestpractical.com>
Date:   Tue Jan 20 22:49:52 2009 +0200

    be a bit more flexible with --to and --from for publish/push and clone/pull

diff --git a/lib/Prophet/CLI/Dispatcher.pm b/lib/Prophet/CLI/Dispatcher.pm
index abeaf7c..c33cf1f 100644
--- a/lib/Prophet/CLI/Dispatcher.pm
+++ b/lib/Prophet/CLI/Dispatcher.pm
@@ -31,10 +31,17 @@ on '' => sub {
 };
 
 # publish foo at bar.com:www/baz => publish --to foo at bar.com:www/baz
-on qr{^publish (\S+)$} => sub {
+on qr{^(publish|push) (\S+)$} => sub {
     my $self = shift;
-    $self->context->set_arg(to => $1) if $1;
-    run('publish', $self);
+    $self->context->set_arg(to => $2);
+    run($1, $self);
+};
+
+# clone http://fsck.com/~jesse/sd-bugs => clone --to http://fsck.com/~jesse/sd-bugs
+on qr{^(clone|pull) (\S+)$} => sub {
+    my $self = shift;
+    $self->context->set_arg(from => $2);
+    run($1, $self);
 };
 
 on [ ['create', 'new'] ]         => run_command("Create");

commit 0e38b8b8ba288ea2f32233bcbae2711ac6ae6c7e
Author: Christine Spang <spang at bestpractical.com>
Date:   Wed Jan 21 00:18:45 2009 +0200

    fix a bug where $prop is 0 (thanks, alex)

diff --git a/lib/Prophet/CLI/Command/Update.pm b/lib/Prophet/CLI/Command/Update.pm
index cd7ca4d..85f9147 100644
--- a/lib/Prophet/CLI/Command/Update.pm
+++ b/lib/Prophet/CLI/Command/Update.pm
@@ -33,8 +33,8 @@ sub run {
 
     # filter out props that haven't changed
     for my $prop (keys %$new_props) {
-        delete $new_props->{$prop}
-            if (($record->prop($prop) || '') eq $new_props->{$prop});
+        my $old_prop = defined $record->prop($prop) ? $record->prop($prop) : '';
+        delete $new_props->{$prop} if ($old_prop eq $new_props->{$prop});
     }
 
     if (keys %$new_props) {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list