[Bps-public-commit] Prophet branch, master, updated. 007f1221f33b320a3473e73e247e9715af12f227

jesse jesse at bestpractical.com
Mon May 18 21:23:05 EDT 2009


The branch, master has been updated
       via  007f1221f33b320a3473e73e247e9715af12f227 (commit)
       via  2a023eb81f7b5851a8588bf143a3d257ef84554b (commit)
      from  acf03ae31ee507c687898c8accd0851811326650 (commit)

Summary of changes:
 lib/Prophet/CLI/Command/Merge.pm |    4 ++--
 lib/Prophet/Replica.pm           |    2 +-
 t/log.t                          |    6 +++---
 t/simple-push.t                  |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 2a023eb81f7b5851a8588bf143a3d257ef84554b
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon May 18 21:02:00 2009 -0400

    fix log.t for ordered log results

diff --git a/t/log.t b/t/log.t
index be26588..0f843c6 100644
--- a/t/log.t
+++ b/t/log.t
@@ -67,11 +67,11 @@ is($end, $handle->latest_sequence_no, 'LATEST ends at latest');
 my $replica_uuid = replica_uuid;
 my $first = " $ENV{PROPHET_EMAIL}".' at \d{4}-\d{2}-\d{2} .+	\(1\@'.$replica_uuid.'\)
  # Person 1 \(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\)
-  \+ "original_replica" set to "'.$replica_uuid.'"
+  \+ "age" set to "0.7"
   \+ "creator" set to "'.$ENV{PROPHET_EMAIL}.'"
   \+ "name" set to "Mao"
-  \+ "species" set to "cat"
-  \+ "age" set to "0.7"';
+  \+ "original_replica" set to "'.$replica_uuid.'"
+  \+ "species" set to "cat"';
 
 my $second = " $ENV{PROPHET_EMAIL}".' at \d{4}-\d{2}-\d{2} .+	\(2\@'.$replica_uuid.'\)
  # Person 1 \(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\)

commit 007f1221f33b320a3473e73e247e9715af12f227
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon May 18 21:22:37 2009 -0400

    Support replicas with an initial sequence number of '0'

diff --git a/lib/Prophet/CLI/Command/Merge.pm b/lib/Prophet/CLI/Command/Merge.pm
index 081f980..6417ca8 100644
--- a/lib/Prophet/CLI/Command/Merge.pm
+++ b/lib/Prophet/CLI/Command/Merge.pm
@@ -90,8 +90,8 @@ sub _do_merge {
 
     my $changesets = 0;
 
-    my $source_latest = $self->source->latest_sequence_no() || 0;
-    my $source_last_seen = $self->target->last_changeset_from_source($self->source->uuid) || 0;
+    my $source_latest = $self->source->latest_sequence_no() ;
+    my $source_last_seen = $self->target->last_changeset_from_source($self->source->uuid);
 
     if( $self->has_arg('verbose') ) {
         print "Integrating changes from ".$source_last_seen . " to ". $source_latest."\n";
diff --git a/lib/Prophet/Replica.pm b/lib/Prophet/Replica.pm
index 4ae4ac6..3089771 100644
--- a/lib/Prophet/Replica.pm
+++ b/lib/Prophet/Replica.pm
@@ -354,7 +354,7 @@ sub last_changeset_from_source {
     my $self = shift;
     my ($source) = validate_pos( @_, { type => SCALAR } );
 
-    return $self->fetch_local_metadata('last-changeset-from-'.$source)||0;
+    return $self->fetch_local_metadata('last-changeset-from-'.$source)||-1;
 }
 
 
diff --git a/t/simple-push.t b/t/simple-push.t
index 7a04797..e51696e 100644
--- a/t/simple-push.t
+++ b/t/simple-push.t
@@ -134,7 +134,7 @@ as_alice {
 
     # sync from bob
     diag('Alice syncs from bob');
-    is( $alice->last_changeset_from_source( $bob->uuid ) => 0 );
+    is( $alice->last_changeset_from_source( $bob->uuid ) => -1 );
     run_ok( 'prophet', [ 'pull', '--from', repo_uri_for('bob') ],
         "Sync ran ok!" );
     is( $alice->last_changeset_from_source( $bob->uuid ) =>

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



More information about the Bps-public-commit mailing list