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

spang at bestpractical.com spang at bestpractical.com
Wed Jan 28 03:03:36 EST 2009


The branch, master has been updated
       via  dcb139e8de9dec48d34ba50b4e57da9022a5386f (commit)
      from  767592aeeca60f218ad7064bec071078f67db514 (commit)

Summary of changes:
 lib/Prophet/Replica/prophet.pm |    6 ++++--
 lib/Prophet/Replica/sqlite.pm  |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit dcb139e8de9dec48d34ba50b4e57da9022a5386f
Author: Christine Spang <spang at bestpractical.com>
Date:   Wed Jan 28 10:03:21 2009 +0200

    add jesse's suggestion for making this clearer

diff --git a/lib/Prophet/Replica/prophet.pm b/lib/Prophet/Replica/prophet.pm
index a0e8f66..1d36431 100644
--- a/lib/Prophet/Replica/prophet.pm
+++ b/lib/Prophet/Replica/prophet.pm
@@ -655,9 +655,11 @@ sub traverse_changesets {
     );
 
     my $first_rev = ( $args{'after'} + 1 ) || 1;
-    my $latest = $args{until} ? $args{until} : $self->latest_sequence_no();
+    my $latest = $self->latest_sequence_no;
 
-    $latest = $self->latest_sequence_no() if $latest > $self->latest_sequence_no();
+    if ( defined $args{until} && $args{until} < $latest) {
+            $latest = $args{until};
+    }
 
     my $chgidx = $self->_read_changeset_index;
     $self->log_debug("Traversing changesets between $first_rev and $latest");
diff --git a/lib/Prophet/Replica/sqlite.pm b/lib/Prophet/Replica/sqlite.pm
index 7c1264f..2a3681d 100644
--- a/lib/Prophet/Replica/sqlite.pm
+++ b/lib/Prophet/Replica/sqlite.pm
@@ -402,9 +402,11 @@ sub traverse_changesets {
     );
 
     my $first_rev = ( $args{'after'} + 1 ) || 1;
-    my $latest = $args{until} ? $args{until} : $self->latest_sequence_no();
+    my $latest = $self->latest_sequence_no;
 
-    $latest = $self->latest_sequence_no() if $latest > $self->latest_sequence_no();
+    if ( defined $args{until} && $args{until} < $latest) {
+            $latest = $args{until};
+    }
 
     $self->log_debug("Traversing changesets between $first_rev and $latest");
     for my $rev ( $first_rev .. $latest ) {

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



More information about the Bps-public-commit mailing list