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

jesse jesse at bestpractical.com
Fri Jan 16 17:21:19 EST 2009


The branch, master has been updated
       via  f1e567e3a25cf9c0e7ed3c059b9fdfd3b2b0cf55 (commit)
       via  dbf44e760307c6e7b89819513b922a1623ac0cf8 (commit)
      from  cf6f7b7ea8a4d2b76de5618a431921c5f9a5d8bb (commit)

Summary of changes:
 lib/Prophet/ForeignReplica.pm |    2 +-
 lib/Prophet/Replica/sqlite.pm |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit dbf44e760307c6e7b89819513b922a1623ac0cf8
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Fri Jan 16 16:30:56 2009 -0500

    fixing a bug in how ForeignReplicas set up their state handle url

diff --git a/lib/Prophet/ForeignReplica.pm b/lib/Prophet/ForeignReplica.pm
index 241f37f..60c4ab2 100644
--- a/lib/Prophet/ForeignReplica.pm
+++ b/lib/Prophet/ForeignReplica.pm
@@ -14,7 +14,7 @@ This abstract baseclass implements the helpers you need to be able to easily syn
 
 sub BUILD {
     my $self = shift;
-    my $state_handle_url =      $self->app_handle->default_replica_type . ":" . $self->app_handle->handle->url;
+    my $state_handle_url =       $self->app_handle->handle->url;
     $self->log( "Connecting to state database ".$state_handle_url);
     $self->state_handle(
         Prophet::Replica->get_handle(

commit f1e567e3a25cf9c0e7ed3c059b9fdfd3b2b0cf55
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Fri Jan 16 17:20:31 2009 -0500

    Fixes to how urls for sqlite state_handle and resolution_handle urls are
    constructed

diff --git a/lib/Prophet/Replica/sqlite.pm b/lib/Prophet/Replica/sqlite.pm
index f6a9473..af5fe8c 100644
--- a/lib/Prophet/Replica/sqlite.pm
+++ b/lib/Prophet/Replica/sqlite.pm
@@ -42,7 +42,7 @@ has fs_root_parent => (
     lazy    => 1,
     default => sub {
         my $self = shift;
-        return $self->url =~ m{^sqlite:file://(.*)/.*?$} ? $1 : undef;
+        return $self->url =~ m{^(?:sqlite\:)?file://(.*)/.*?$} ? $1 : undef;
     }
 );
 
@@ -51,7 +51,7 @@ has fs_root => (
     lazy    => 1,
     default => sub {
         my $self = shift;
-        return $self->url =~ m{^sqlite:file://(.*)$} ? $1 : undef;
+        return $self->url =~ m{^(?:sqlite\:)?file://(.*)$} ? $1 : undef;
     },
 );
 
@@ -98,7 +98,7 @@ sub BUILD {
 
 sub _check_for_upgrades {
     my $self = shift;
-   if ($self->replica_version && $self->replica_version < 2) {
+   if  ( $self->replica_version && $self->replica_version < 2) {
         $self->_upgrade_replica_to_v2();
    } 
 
@@ -202,7 +202,6 @@ sub initialize {
         }
     );
 
-
     if ( !$self->fs_root_parent ) {
 
         if ( $self->can_write_changesets ) {

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



More information about the Bps-public-commit mailing list