[Bps-public-commit] r11735 - in Prophet/trunk: . lib/Prophet/Replica

jesse at bestpractical.com jesse at bestpractical.com
Tue Apr 15 17:15:06 EDT 2008


Author: jesse
Date: Tue Apr 15 17:15:05 2008
New Revision: 11735

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/Replica.pm
   Prophet/trunk/lib/Prophet/Replica/FS.pm
   Prophet/trunk/lib/Prophet/Replica/Native.pm
   Prophet/trunk/lib/Prophet/Replica/SVN.pm
   Prophet/trunk/lib/Prophet/ReplicaExporter.pm

Log:
 r29713 at 31b:  jesse | 2008-04-14 23:31:37 -0400
 most_recent_changeset -> latest_sequence_no 


Modified: Prophet/trunk/lib/Prophet/Replica.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica.pm	Tue Apr 15 17:15:05 2008
@@ -264,7 +264,7 @@
 
     my $filename = join( "/", $self->db_uuid, $MERGETICKET_METATYPE, $source );
     my ( $rev_fetched, $props )
-        = eval { $self->ra->get_file( $filename, $self->most_recent_changeset, $stream, $pool ); };
+        = eval { $self->ra->get_file( $filename, $self->latest_sequence_no, $stream, $pool ); };
 
     # XXX TODO this is hacky as hell and violates abstraction barriers in the name of doing things over the RA
     # because we want to be able to sync to a remote replica someday.
@@ -445,13 +445,13 @@
     );
 
     my $first_rev = ( $args{'after'} + 1 ) || 1;
-    my $last_rev = $self->most_recent_changeset();
+    my $last_rev = $self->latest_sequence_no();
 
 
-    die "you must implement most_recent_changeset in " . ref($self) . ", or override traverse_changesets"
+    die "you must implement latest_sequence_no in " . ref($self) . ", or override traverse_changesets"
         unless defined $last_rev;
 
-    for my $rev ( $first_rev .. $self->most_recent_changeset ) {
+    for my $rev ( $first_rev .. $self->latest_sequence_no ) {
         $args{callback}->( $self->fetch_changeset($rev) );
     }
 }
@@ -490,13 +490,13 @@
 
 sub uuid {}
 
-=head2 most_recent_changeset
+=head2 latest_sequence_no
 
 Returns the sequence # of the most recently committed changeset
 
 =cut
 
-sub most_recent_changeset {return undef }
+sub latest_sequence_no {return undef }
 
 =head2 fetch_changeset SEQUENCE_NO
 

Modified: Prophet/trunk/lib/Prophet/Replica/FS.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/FS.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/FS.pm	Tue Apr 15 17:15:05 2008
@@ -15,7 +15,7 @@
 sub uuid {
     my $self = shift;
 }
-sub most_recent_changeset {
+sub latest_sequence_no {
     my $self = shift;
 }
 sub fetch_changeset {

Modified: Prophet/trunk/lib/Prophet/Replica/Native.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/Native.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/Native.pm	Tue Apr 15 17:15:05 2008
@@ -52,7 +52,7 @@
     make_tiered_dirs( $self->record_cas_dir );
     make_tiered_dirs( $self->changeset_cas_dir );
 
-    $self->set_most_recent_changeset_no("1");
+    $self->set_latest_sequence_no("1");
     $self->set_replica_uuid(Data::UUID->new->create_str);
     $self->_output_oneliner_file( path => file( $self->fs_root, 'replica-version' ), content => '1' );
 }
@@ -64,7 +64,7 @@
 
 }
 
-sub set_most_recent_changeset_no {
+sub set_latest_sequence_no {
     my $self = shift;
     my $id = shift;
     $self->_output_oneliner_file( path    => file( $self->fs_root, 'latest-sequence-no' ), content => scalar($id));
@@ -168,7 +168,7 @@
     );
 
     my $first_rev = ( $args{'after'} + 1 ) || 1;
-    my $latest    = $self->most_recent_changeset();
+    my $latest    = $self->latest_sequence_no();
     my $chgidx    = LWP::Simple::get( $self->url . '/changesets.idx' );
 
     for my $rev ( $first_rev .. $latest ) {
@@ -188,7 +188,7 @@
     }
 }
 
-sub most_recent_changeset {
+sub latest_sequence_no {
     my $self = shift;
     return LWP::Simple::get( $self->url . '/latest-sequence-no' );
 }

Modified: Prophet/trunk/lib/Prophet/Replica/SVN.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/SVN.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/SVN.pm	Tue Apr 15 17:15:05 2008
@@ -90,7 +90,7 @@
     return $self->repo_handle->fs->get_uuid;
 }
 
-sub most_recent_changeset {
+sub latest_sequence_no {
     my $self = shift;
     Carp::cluck unless ($self->ra);
     $self->ra->get_latest_revnum;

Modified: Prophet/trunk/lib/Prophet/ReplicaExporter.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/ReplicaExporter.pm	(original)
+++ Prophet/trunk/lib/Prophet/ReplicaExporter.pm	Tue Apr 15 17:15:05 2008
@@ -180,7 +180,7 @@
 
 sub _init_export_metadata {
     my $self = shift;
-    $self->target_replica->set_most_recent_changeset_no( $self->source_replica->most_recent_changeset );
+    $self->target_replica->set_latest_sequence_no( $self->source_replica->latest_sequence_no );
     $self->target_replica->set_replica_uuid( $self->source_replica->uuid );
 
 }



More information about the Bps-public-commit mailing list