[Bps-public-commit] r11429 - in SVN-PropDB: . lib/Prophet/Sync/Source

jesse at bestpractical.com jesse at bestpractical.com
Thu Apr 3 05:30:52 EDT 2008


Author: jesse
Date: Thu Apr  3 05:30:50 2008
New Revision: 11429

Modified:
   SVN-PropDB/   (props changed)
   SVN-PropDB/lib/Prophet/Sync/Source.pm
   SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm

Log:
 r29047 at 68-247-224-106:  jesse | 2008-04-02 23:30:02 -1000
  * now possible to have a second replica type


Modified: SVN-PropDB/lib/Prophet/Sync/Source.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Sync/Source.pm	(original)
+++ SVN-PropDB/lib/Prophet/Sync/Source.pm	Thu Apr  3 05:30:50 2008
@@ -6,6 +6,7 @@
 use Params::Validate qw(:all);
 use UNIVERSAL::require;
 
+
 =head1 NAME
 
 Prophet::Sync::Source
@@ -26,7 +27,7 @@
 
 sub new {
     my $self = shift->SUPER::new(@_);
-    $self->rebless_to_replica_type();
+    $self->rebless_to_replica_type(@_);
     $self->setup();
     return $self;
 }
@@ -42,7 +43,17 @@
 
 sub rebless_to_replica_type {
     my $self  = shift;
-    my $class = 'Prophet::Sync::Source::SVN';
+    my $args = shift;
+
+    my $class;
+    
+    # XXX TODO HACK NEED A PROPER WAY TO DETERMINE SYNC SOURCE
+    if ($args->{url} =~ /^http/) {
+            $class    = 'Prophet::Sync::Source::RT';
+        } 
+        else { 
+            $class    = 'Prophet::Sync::Source::SVN';
+        }
     $class->require;
     bless $self, $class;
 }
@@ -267,4 +278,19 @@
     return $records;
 }
 
+=head2 news_changesets_for
+
+Returns the local changesets that are new to the replica $other.
+
+=cut
+
+sub new_changesets_for {
+    my ($self, $other) = @_;
+
+    my $since = $other->last_changeset_from_source( $self->uuid );
+    $self->fetch_changesets( after => $since );
+}
+
+
+
 1;

Modified: SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm	(original)
+++ SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm	Thu Apr  3 05:30:50 2008
@@ -169,25 +169,5 @@
 
 }
 
-=head2 news_changesets_for
-
-Returns the local changesets that are new to the replica $other.
-
-=cut
-
-sub new_changesets_for {
-    my ($self, $other) = @_;
-
-    my $since = $other->last_changeset_from_source( $self->uuid );
-
-    return [
-        grep { !( $_->is_nullification || $_->is_resolution )
-                && !$other->has_seen_changeset($_)
-            } @{ $self->fetch_changesets( after => $since ) }
-    ];
-
-}
-
-
 
 1;



More information about the Bps-public-commit mailing list