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

sartak at bestpractical.com sartak at bestpractical.com
Thu Jul 24 00:49:56 EDT 2008


Author: sartak
Date: Thu Jul 24 00:49:53 2008
New Revision: 14457

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

Log:
 r64979 at onn:  sartak | 2008-07-24 00:49:40 -0400
 For consistency, name the db_uuid writer set_db_uuid


Modified: Prophet/trunk/lib/Prophet/Replica.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica.pm	Thu Jul 24 00:49:53 2008
@@ -26,8 +26,9 @@
 );
 
 has db_uuid => (
-    is  => 'rw',
-    isa => 'Str',
+    is     => 'rw',
+    isa    => 'Str',
+    writer => 'set_db_uuid',
 );
 
 has url => (

Modified: Prophet/trunk/lib/Prophet/Replica/Native.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/Native.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/Native.pm	Thu Jul 24 00:49:53 2008
@@ -236,15 +236,14 @@
     return $self->_db_uuid;
 }
 
-sub set_db_uuid {
+before set_db_uuid => sub {
     my $self = shift;
     my $uuid = shift;
     $self->_write_file(
         path    => 'database-uuid',
         content => $uuid
     );
-
-}
+};
 
 =head1 Internals of record handling
 

Modified: Prophet/trunk/lib/Prophet/Replica/SVN.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/SVN.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/SVN.pm	Thu Jul 24 00:49:53 2008
@@ -73,7 +73,7 @@
     my $self = shift;
     my %args = validate( @_, { repository => 1, db_uuid => 0 } );
     $self->fs_root( $args{'repository'} );
-    $self->db_uuid( $args{'db_uuid'} ) if ( $args{'db_uuid'} );
+    $self->set_db_uuid( $args{'db_uuid'} ) if ( $args{'db_uuid'} );
     
     my $repos = eval { SVN::Repos::open( $self->fs_root ); };
     # If we couldn't open the repository handle, we should create it
@@ -226,14 +226,14 @@
 
     for my $key ( keys %{ $self->_current_root->dir_entries("/") } ) {
         if ( $key =~ /^_prophet-/ ) {
-            $self->db_uuid($key);
+            $self->set_db_uuid($key);
             return DETECTED_DB_UUID;
         }
     }
 
     # no luck. create one
 
-    $self->db_uuid( "_prophet-" . Data::UUID->new->create_str() );
+    $self->set_db_uuid( "_prophet-" . Data::UUID->new->create_str() );
     return CREATED_DB_UUID;
 }
 



More information about the Bps-public-commit mailing list