[Bps-public-commit] r11796 - in Prophet/trunk: . t

jesse at bestpractical.com jesse at bestpractical.com
Sat Apr 19 20:54:19 EDT 2008


Author: jesse
Date: Sat Apr 19 20:54:16 2008
New Revision: 11796

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/Replica/Native.pm
   Prophet/trunk/t/export.t
   Prophet/trunk/t/simple-push.t

Log:
 r29933 at 31b:  jesse | 2008-04-20 02:53:10 +0200
 * no, merge tickets will live in the changesets they're tied to.


Modified: Prophet/trunk/lib/Prophet/Replica/Native.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/Native.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/Native.pm	Sat Apr 19 20:54:16 2008
@@ -41,7 +41,7 @@
     $self->_probe_or_create_db();
 
 
-    $self->state_handle( Prophet::Replica->new( { url => "prophet:".$self->{url}, is_state_handle =>1 } ) ) unless ( $self->is_state_handle || $self->state_handle);
+    # $self->state_handle( Prophet::Replica->new( { url => "prophet:".$self->{url}, is_state_handle =>1 } ) ) unless ( $self->is_state_handle || $self->state_handle);
 
     $self->resolution_db_handle( Prophet::Replica->new( { url => "prophet:".$self->{url}.'/resolutions', is_resdb => 1 } ) )
         unless ( $self->is_resdb || $self->is_state_handle);
@@ -52,7 +52,7 @@
 
 }
 
-#sub state_handle { return shift; }
+sub state_handle { return shift; }
 
 sub _probe_or_create_db {
     my $self = shift;
@@ -91,10 +91,6 @@
         path    => 'replica-version',
         content => '1'
     );
-    for(1..2) { # XXXX HORRIBLE HACK TO WORK AROUND THE FACT THAT SVN RECORDS EMPTY CHANGESETS
-        # $self->begin_edit;
-        #  $self->commit_edit;
-    }
 }
 
 

Modified: Prophet/trunk/t/export.t
==============================================================================
--- Prophet/trunk/t/export.t	(original)
+++ Prophet/trunk/t/export.t	Sat Apr 19 20:54:16 2008
@@ -42,7 +42,7 @@
         'content is correct'
     );
 
-    my $path = Path::Class::dir->new( tempdir( CLEANUP => ! $ENV{TEST_VERBOSE} ) );
+    my $path = Path::Class::dir->new( tempdir( CLEANUP => !  $ENV{TEST_VERBOSE} ) );
 
     run_ok( 'prophet', [ 'export', '--path', $path ] );
     my $cli = Prophet::CLI->new;
@@ -55,12 +55,12 @@
 
     ok( -e $path->file('changesets.idx'), 'found changesets index' );
     my $latest = $path->file('latest-sequence-no')->slurp;
-    is( $latest, 5 );
+    is( $latest, $cli->app_handle->handle->latest_sequence_no );
     use_ok('Prophet::Replica::Native');
     diag("Checking changesets in $path");
-    my $changesets = Prophet::Replica->new( { url => 'prophet:file://' . $path } )->fetch_changesets( after => 0 );
-    is( $#{$changesets}, 4, "We found a total of 5 changesets" );
-
+    my $changesets =  Prophet::Replica->new( { url => 'prophet:file://' . $path } )->fetch_changesets( after => 0 );
+    my @changesets = grep {!$_->is_empty} @$changesets;
+    is( $#changesets, 2, "We found a total of 3 changesets" );
     # XXX: compare the changeset structure
     is( lc( $changesets->[-1]->{source_uuid} ), lc( $changesets->[-1]->{original_source_uuid} ) );
 

Modified: Prophet/trunk/t/simple-push.t
==============================================================================
--- Prophet/trunk/t/simple-push.t	(original)
+++ Prophet/trunk/t/simple-push.t	Sat Apr 19 20:54:16 2008
@@ -45,23 +45,8 @@
 };
 
 is_deeply(
-    [ map { $_->as_hash } @$changesets ],
-    [   {   'sequence_no'          => 1,
-            'original_sequence_no' => 1,
-            'is_empty'             => 1,
-            'is_nullification'     => undef,
-            'original_source_uuid' => replica_uuid_for('bob'),
-            'is_resolution'        => undef,
-            'source_uuid'          => replica_uuid_for('bob')
-        },
-        {   'sequence_no'          => 2,
-            'original_sequence_no' => 2,
-            'is_empty'             => 1,
-            'is_nullification'     => undef,
-            'original_source_uuid' => replica_uuid_for('bob'),
-            'is_resolution'        => undef,
-            'source_uuid'          => replica_uuid_for('bob')
-        },
+    [ map { $_->as_hash } grep { !$_->is_empty}  @$changesets ],
+    [ 
         {   'sequence_no'          => 3,
             'original_sequence_no' => 3,
             'original_source_uuid' => replica_uuid_for('bob'),
@@ -112,7 +97,7 @@
 
 $changesets = $bob->new_changesets_for($alice);
 
-my @changes = map { $_->as_hash } @$changesets;
+my @changes = map { $_->as_hash } grep {!$_->is_empty} @$changesets;
 
 is_deeply(
     \@changes,



More information about the Bps-public-commit mailing list