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

jesse at bestpractical.com jesse at bestpractical.com
Wed Apr 16 14:41:46 EDT 2008


Author: jesse
Date: Wed Apr 16 14:41:44 2008
New Revision: 11756

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/Replica/Native.pm
   Prophet/trunk/lib/Prophet/Test.pm
   Prophet/trunk/t/canonicalize.t
   Prophet/trunk/t/validate.t

Log:
 r29768 at 31b:  jesse | 2008-04-16 14:41:26 -0400
 * Support for running all tests against native replicas. 
   I think all we're missing now is 'record changeset as we create'


Modified: Prophet/trunk/lib/Prophet/Replica/Native.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/Native.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/Native.pm	Wed Apr 16 14:41:44 2008
@@ -61,6 +61,10 @@
 }
 
 
+use constant can_read_records => 1;
+use constant can_read_changesets => 1;
+sub can_write_changesets { return (shift->fs_root ? 1 : 0) }
+sub can_write_records { return (shift->fs_root ? 1 : 0) }
 
 
 sub initialize {
@@ -237,7 +241,6 @@
         my ( $seq, $orig_uuid, $orig_seq, $key )
             = unpack( 'Na16NH40', substr( $chgidx, ( $rev - 1 ) * CHG_RECORD_SIZE, CHG_RECORD_SIZE ) );
         $orig_uuid = Data::UUID->new->to_string($orig_uuid);
-
         # XXX: deserialize the changeset content from the cas with $key
         my $casfile = file ($self->changeset_cas_dir, substr( $key, 0, 1 ), substr( $key, 1, 1 ) , $key);
         my $changeset = $self->_deserialize_changeset(

Modified: Prophet/trunk/lib/Prophet/Test.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Test.pm	(original)
+++ Prophet/trunk/lib/Prophet/Test.pm	Wed Apr 16 14:41:44 2008
@@ -16,6 +16,9 @@
 
 use Prophet::CLI;
 
+use constant DEFAULT_REPLICA_TYPE => 'svn';
+
+
 our $REPO_BASE = File::Temp::tempdir();
 Test::More->import;
 diag( "Replicas can be found in" . $REPO_BASE );
@@ -204,7 +207,7 @@
     my $path = repo_path_for($username);
     $path =~ s{^|\\}{/}g if IS_WIN32;
 
-    return 'svn:file://' . $path;
+    return ($ENV{'PROPHET_REPLICA_TYPE'}|| __PACKAGE__->DEFAULT_REPLICA_TYPE) . ':file://' . $path;
 }
 
 sub replica_uuid {

Modified: Prophet/trunk/t/canonicalize.t
==============================================================================
--- Prophet/trunk/t/canonicalize.t	(original)
+++ Prophet/trunk/t/canonicalize.t	Wed Apr 16 14:41:44 2008
@@ -3,10 +3,11 @@
 use Test::More  tests => 7;
 use File::Temp qw'tempdir';
 use lib 't/lib';
+my $SCHEME = $ENV{'PROPHET_REPLICA_TYPE'} || 'svn';
 
 use_ok('Prophet::Replica');
 my $REPO = tempdir( CLEANUP => 0 ) . '/repo-' . $$;
-my $cxn = Prophet::Replica->new( {url  => "svn:file://$REPO"} );
+my $cxn = Prophet::Replica->new( {url  => "$SCHEME:file://$REPO"} );
 isa_ok( $cxn, 'Prophet::Replica', "Got the cxn" );
 use_ok('TestApp::Bug');
 

Modified: Prophet/trunk/t/validate.t
==============================================================================
--- Prophet/trunk/t/validate.t	(original)
+++ Prophet/trunk/t/validate.t	Wed Apr 16 14:41:44 2008
@@ -6,9 +6,11 @@
 use lib 't/lib';
 use Test::Exception;
 
+my $SCHEME = $ENV{'PROPHET_REPLICA_TYPE'} || 'svn';
+
 use_ok('Prophet::Replica');
 my $REPO = tempdir( CLEANUP => 0 ) . '/repo-' . $$;
-my $cxn = Prophet::Replica->new( { url => "svn:file://$REPO" });
+my $cxn = Prophet::Replica->new( { url => "$SCHEME:file://$REPO" });
 isa_ok( $cxn, 'Prophet::Replica', "Got the cxn" );
 use_ok('TestApp::Bug');
 



More information about the Bps-public-commit mailing list