[Bps-public-commit] r11718 - in Prophet/trunk: . lib/Prophet lib/Prophet/Replica lib/Prophet/Replica/SVN lib/Prophet/Resolver t

jesse at bestpractical.com jesse at bestpractical.com
Sun Apr 13 20:44:48 EDT 2008


Author: jesse
Date: Sun Apr 13 20:44:46 2008
New Revision: 11718

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/MANIFEST
   Prophet/trunk/doc/glossary
   Prophet/trunk/doc/notes-on-merging
   Prophet/trunk/lib/Prophet/Change.pm
   Prophet/trunk/lib/Prophet/Conflict.pm
   Prophet/trunk/lib/Prophet/Replica.pm
   Prophet/trunk/lib/Prophet/Replica/SVN.pm
   Prophet/trunk/lib/Prophet/Replica/SVN/ReplayEditor.pm
   Prophet/trunk/lib/Prophet/Resolver/Failed.pm
   Prophet/trunk/lib/Prophet/Test.pm
   Prophet/trunk/t/export.t
   Prophet/trunk/t/non-conflicting-merge.t
   Prophet/trunk/t/real-conflicting-merge.t
   Prophet/trunk/t/simple-conflicting-merge.t
   Prophet/trunk/t/simple-push.t

Log:
 r29648 at 31b:  jesse | 2008-04-13 20:43:43 -0400
  Complete the node->record transition


Modified: Prophet/trunk/MANIFEST
==============================================================================
--- Prophet/trunk/MANIFEST	(original)
+++ Prophet/trunk/MANIFEST	Sun Apr 13 20:44:46 2008
@@ -1,12 +1,12 @@
 bin/generalized_sync_n_merge.t
 bin/prophet
 bin/prophet-merge
-bin/prophet-node-create
-bin/prophet-node-delete
-bin/prophet-node-history
-bin/prophet-node-search
-bin/prophet-node-show
-bin/prophet-node-update
+bin/prophet-record-create
+bin/prophet-record-delete
+bin/prophet-record-history
+bin/prophet-record-search
+bin/prophet-record-show
+bin/prophet-record-update
 bin/run_test_yml.pl
 bin/sd
 bin/taste_recipe

Modified: Prophet/trunk/doc/glossary
==============================================================================
--- Prophet/trunk/doc/glossary	(original)
+++ Prophet/trunk/doc/glossary	Sun Apr 13 20:44:46 2008
@@ -69,10 +69,10 @@
 =head2 Conflict
     A Conflict occurs when a Changeset is being applied and the current state of a Replica meets any of the following criteria:
 
-        * The Replica already contains a node marked as "created" in the changeset
-        * The Replica doesn't contain a node marked as "deleted" in the changeset
-        * The Replica doesn't contain a node marked as "updated" in the changeset
-        * The Replica contains a node marked as "updated" in the changeset, but the current state of the properties on the node does not match the "old" state of the node in the changeset.
+        * The Replica already contains a record marked as "created" in the changeset
+        * The Replica doesn't contain a record marked as "deleted" in the changeset
+        * The Replica doesn't contain a record marked as "updated" in the changeset
+        * The Replica contains a record marked as "updated" in the changeset, but the current state of the properties on the record does not match the "old" state of the record in the changeset.
     
 =head2 Resolution
     When the local Replica 

Modified: Prophet/trunk/doc/notes-on-merging
==============================================================================
--- Prophet/trunk/doc/notes-on-merging	(original)
+++ Prophet/trunk/doc/notes-on-merging	Sun Apr 13 20:44:46 2008
@@ -98,7 +98,7 @@
 
 in the worst case, assume they decide on "Y beats Z"
 
-Do we need a 4th node for the pessimal case here?
+Do we need a 4th record for the pessimal case here?
 
 Then A<->C sync.
 

Modified: Prophet/trunk/lib/Prophet/Change.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Change.pm	(original)
+++ Prophet/trunk/lib/Prophet/Change.pm	Sun Apr 13 20:44:46 2008
@@ -14,17 +14,17 @@
 
 =head1 DESCRIPTION
 
-This class encapsulates a change to a single node in a Prophet replica.
+This class encapsulates a change to a single record in a Prophet replica.
 
 =head1 METHODS
 
 =head2 record_type
 
-The record type for the node.
+The record type for the record.
 
 =head2 record_uuid
 
-The UUID of the node being changed
+The UUID of the record being changed
 
 =head2 change_type
 

Modified: Prophet/trunk/lib/Prophet/Conflict.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Conflict.pm	(original)
+++ Prophet/trunk/lib/Prophet/Conflict.pm	Sun Apr 13 20:44:46 2008
@@ -87,7 +87,7 @@
 
     my $file_exists = $self->prophet_handle->record_exists( uuid => $change->record_uuid, type => $change->record_type );
 
-    # It's ok to delete a node that exists
+    # It's ok to delete a record that exists
     if ( $change->change_type eq 'delete' && !$file_exists ) {
         $file_op_conflict = "delete_missing_file";
     } elsif ( $change->change_type eq 'update_file' && !$file_exists ) {
@@ -121,7 +121,7 @@
 
 =head2 _generate_prop_change_conflicts Prophet::Change %hash_of_current_properties
 
-Given a change and the current state of a node, returns an array of Prophet::ConflictingPropChange objects describing conflicts which would occur if the change were applied
+Given a change and the current state of a record, returns an array of Prophet::ConflictingPropChange objects describing conflicts which would occur if the change were applied
 
 
 =cut

Modified: Prophet/trunk/lib/Prophet/Replica.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica.pm	Sun Apr 13 20:44:46 2008
@@ -156,7 +156,7 @@
 
     # when we start to integrate a changeset, we need to do a bit of housekeeping
     # We never want to merge in:
-    # merge tickets that describe merges from the local node
+    # merge tickets that describe merges from the local record
 
     # When we integrate changes, sometimes we will get handed changes we already know about.
     #   - changes from local
@@ -719,7 +719,7 @@
 
     my $props = eval { $self->get_record_props( uuid => $source_uuid, type => $name ) };
 
-    # XXX: do set-prop when exists, and just create new node with all props is probably better
+    # XXX: do set-prop when exists, and just create new record with all props is probably better
     unless ( $props->{$prop_name} ) {
         eval { $self->create_record( uuid => $source_uuid, type => $name, props => {} ) };
     }
@@ -750,7 +750,7 @@
 
 =head2 delete_record {uuid => $uuid, type => $type }
 
-Deletes the node C<$uuid> of type C<$type> from the current replica. 
+Deletes the record C<$uuid> of type C<$type> from the current replica. 
 
 Manufactures its own new edit if C<$self->current_edit> is undefined.
 
@@ -776,7 +776,7 @@
 
 =head2 record_exists {uuid => $uuid, type => $type, root => $root }
 
-Returns true if the node in question exists. False otherwise
+Returns true if the record in question exists. False otherwise
 
 
 =head2 list_records { type => $type }

Modified: Prophet/trunk/lib/Prophet/Replica/SVN.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/SVN.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/SVN.pm	Sun Apr 13 20:44:46 2008
@@ -126,7 +126,7 @@
         }
     );
 
-    # add each node's changes to the changeset
+    # add each record's changes to the changeset
     for my $path ( keys %{ $entry->{'paths'} } ) {
         if ( $path =~ qr|^(.+)/(.*?)/(.*?)$| ) {
             my ( $prefix, $type, $record ) = ( $1, $2, $3 );
@@ -173,13 +173,13 @@
 use constant can_write_changesets => 1;
 
 
-=head2 current_root
+=head2 _current_root
 
 Returns a handle to the svn filesystem's HEAD
 
 =cut
 
-sub current_root {
+sub _current_root {
     my $self = shift;
     $self->repo_handle->fs->revision_root( $self->repo_handle->fs->youngest_rev );
 }
@@ -191,9 +191,9 @@
 sub _determine_db_uuid {
     my $self = shift;
     return USER_PROVIDED_DB_UUID if $self->db_uuid;
-    my @known_replicas = keys %{ $self->current_root->dir_entries("/") };
+    my @known_replicas = keys %{ $self->_current_root->dir_entries("/") };
 
-    for my $key ( keys %{ $self->current_root->dir_entries("/") } ) {
+    for my $key ( keys %{ $self->_current_root->dir_entries("/") } ) {
         if ( $key =~ /^_prophet-/ ) {
             $self->db_uuid($key);
             return DETECTED_DB_UUID;
@@ -235,7 +235,7 @@
     my $self = shift;
     my $dir  = shift;
     my $pool = SVN::Pool->new_default;
-    my $root = $self->current_edit ? $self->current_edit->root : $self->current_root;
+    my $root = $self->current_edit ? $self->current_edit->root : $self->_current_root;
 
     unless ( $root->is_dir($dir) ) {
         my $inside_edit = $self->current_edit ? 1 : 0;
@@ -327,7 +327,7 @@
 
 =head2 delete_record {uuid => $uuid, type => $type }
 
-Deletes the node C<$uuid> of type C<$type> from the current replica. 
+Deletes the record C<$uuid> of type C<$type> from the current replica. 
 
 Manufactures its own new edit if C<$self->current_edit> is undefined.
 
@@ -371,26 +371,16 @@
 
 }
 
-=head2 get_record_props {uuid => $uuid, type => $type, root => $root }
+=head2 get_record_props {uuid => $uuid, type => $type }
 
 Returns a hashref of all properties for the record of type $type with uuid C<$uuid>.
 
-'root' is an optional argument which you can use to pass in an alternate historical version of the replica to inspect.  Code to look at the immediately previous version of a record might look like:
-
-    $handle->get_record_props(
-        type => $record->type,
-        uuid => $record->uuid,
-        root => $self->repo_handle->fs->revision_root( $self->repo_handle->fs->youngest_rev - 1 )
-    );
-
-
 =cut
 
 sub get_record_props {
     my $self = shift;
-    my %args = validate( @_, { uuid => 1, type => 1, root => undef } );
-    my $root = $args{'root'} || $self->current_root;
-    return $root->node_proplist( $self->_file_for( uuid => $args{'uuid'}, type => $args{'type'} ) );
+    my %args = validate( @_, { uuid => 1, type => 1 } );
+    return $self->_current_root->node_proplist( $self->_file_for( uuid => $args{'uuid'}, type => $args{'type'} ) );
 }
 
 =head2 _file_for { uuid => $UUID, type => $type }
@@ -418,7 +408,7 @@
 
 =head2 record_exists {uuid => $uuid, type => $type, root => $root }
 
-Returns true if the node in question exists. False otherwise
+Returns true if the record in question exists. False otherwise
 
 =cut
 
@@ -426,7 +416,7 @@
     my $self = shift;
     my %args = validate( @_, { uuid => 1, type => 1, root => undef } );
 
-    my $root = $args{'root'} || $self->current_root;
+    my $root = $args{'root'} || $self->_current_root;
     return $root->check_path( $self->_file_for( uuid => $args{'uuid'}, type => $args{'type'} ) );
 
 }
@@ -440,7 +430,7 @@
 sub list_records {
     my $self = shift;
     my %args = validate( @_ => { type => 1 } );
-    return [ keys %{ $self->current_root->dir_entries( $self->db_uuid . '/' . $args{type} . '/' ) } ];
+    return [ keys %{ $self->_current_root->dir_entries( $self->db_uuid . '/' . $args{type} . '/' ) } ];
 }
 
 =head2 list_types
@@ -451,7 +441,7 @@
 
 sub list_types {
     my $self = shift;
-    return [ keys %{ $self->current_root->dir_entries( $self->db_uuid . '/' ) } ];
+    return [ keys %{ $self->_current_root->dir_entries( $self->db_uuid . '/' ) } ];
 }
 
 
@@ -466,7 +456,7 @@
     my $self = shift;
     my %args = validate( @_, { type => 1, root => undef } );
 
-    my $root = $args{'root'} || $self->current_root;
+    my $root = $args{'root'} || $self->_current_root;
     return $root->check_path( $self->_directory_for_type( type => $args{'type'}, ) );
 
 }

Modified: Prophet/trunk/lib/Prophet/Replica/SVN/ReplayEditor.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/SVN/ReplayEditor.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/SVN/ReplayEditor.pm	Sun Apr 13 20:44:46 2008
@@ -171,7 +171,7 @@
 =head2 change_file_prop ($baton, $name, $value,$pool)
 
 Called by Subversion when a file property changes. All Subversion
-tells us is that 'the current node's property called $name has
+tells us is that 'the current record's property called $name has
 changed to $value'. This routine roots around and builds a delta
 from the previous value to the new value.
 
@@ -190,7 +190,7 @@
 =head2 change_dir_prop ($baton, $name, $value,$pool)
 
 Called by Subversion when a directory property changes. All Subversion
-tells us is that 'the current node's property called $name has
+tells us is that 'the current record's property called $name has
 changed to $value'. This routine roots around and builds a delta
 from the previous value to the new value.
 

Modified: Prophet/trunk/lib/Prophet/Resolver/Failed.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Resolver/Failed.pm	(original)
+++ Prophet/trunk/lib/Prophet/Resolver/Failed.pm	Sun Apr 13 20:44:46 2008
@@ -8,8 +8,8 @@
     my $self               = shift;
     my $conflicting_change = shift;
     my $conflict           = shift;
-    Carp::cluck Dumper($conflict);
-    use Data::Dumper;
+    #Carp::cluck Dumper($conflict);
+    #use Data::Dumper;
 
     die "The resolution was not resolved. Sorry dude. (Once Prophet works, you should NEVER see this message)";
 }

Modified: Prophet/trunk/lib/Prophet/Test.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Test.pm	(original)
+++ Prophet/trunk/lib/Prophet/Test.pm	Sun Apr 13 20:44:46 2008
@@ -3,8 +3,7 @@
 
 package Prophet::Test;
 use base qw/Test::More Exporter/;
-our @EXPORT
-    = qw/as_alice as_bob as_charlie as_david as_user run_ok repo_uri_for run_script run_output_matches replica_last_rev replica_merge_tickets replica_uuid_for fetch_newest_changesets ok_added_revisions replica_uuid
+our @EXPORT = qw/as_alice as_bob as_charlie as_david as_user run_ok repo_uri_for run_script run_output_matches replica_last_rev replica_merge_tickets replica_uuid_for fetch_newest_changesets ok_added_revisions replica_uuid
     serialize_conflict serialize_changeset in_gladiator diag
     /;
 

Modified: Prophet/trunk/t/export.t
==============================================================================
--- Prophet/trunk/t/export.t	(original)
+++ Prophet/trunk/t/export.t	Sun Apr 13 20:44:46 2008
@@ -26,7 +26,7 @@
 
     # check our local replicas
     my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
-    like( $out, qr/new/, "We have the one node from alice" );
+    like( $out, qr/new/, "We have the one record from alice" );
     if ( $out =~ /^(.*?)\s./ ) {
         $record_id = $1;
     }

Modified: Prophet/trunk/t/non-conflicting-merge.t
==============================================================================
--- Prophet/trunk/t/non-conflicting-merge.t	(original)
+++ Prophet/trunk/t/non-conflicting-merge.t	Sun Apr 13 20:44:46 2008
@@ -9,18 +9,18 @@
     run_ok( 'prophet', [qw(create --type Bug --status new --from alice )], "Created a record as alice" );
     run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/new/], " Found our record" );
 
-    # update the node
-    # show the node history
-    # show the node
+    # update the record
+    # show the record history
+    # show the record
 };
 
 as_bob {
     run_ok( 'prophet', [qw(create --type Bug --status open --from bob )], "Created a record as bob" );
     run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/open/], " Found our record" );
 
-    # update the node
-    # show the node history
-    # show the node
+    # update the record
+    # show the record history
+    # show the record
 
 };
 
@@ -94,18 +94,18 @@
 
 }
 
-# create 1 node
-# search for the node
+# create 1 record
+# search for the record
 #
 # clone the replica to a second replica
 # compare the second replica to the first replica
 #   search
-#   node history
-#   node basics
+#   record history
+#   record basics
 #
 # update the first replica
 # merge the first replica to the second replica
-#   does node history on the second replica reflect the first replica
+#   does record history on the second replica reflect the first replica
 
 # merge the second replica to the first replica
 # ensure that no new transactions aside from a merge ticket are added to the first replica

Modified: Prophet/trunk/t/real-conflicting-merge.t
==============================================================================
--- Prophet/trunk/t/real-conflicting-merge.t	(original)
+++ Prophet/trunk/t/real-conflicting-merge.t	Sun Apr 13 20:44:46 2008
@@ -23,7 +23,7 @@
 
     # check our local replicas
     my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
-    like( $out, qr/new/, "We have the one node from alice" );
+    like( $out, qr/new/, "We have the one record from alice" );
     if ( $out =~ /^(.*?)\s./ ) {
         $record_id = $1;
     }

Modified: Prophet/trunk/t/simple-conflicting-merge.t
==============================================================================
--- Prophet/trunk/t/simple-conflicting-merge.t	(original)
+++ Prophet/trunk/t/simple-conflicting-merge.t	Sun Apr 13 20:44:46 2008
@@ -23,7 +23,7 @@
 
     # check our local replicas
     my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
-    like( $out, qr/new/, "We have the one node from alice" );
+    like( $out, qr/new/, "We have the one record from alice" );
     if ( $out =~ /^(.*?)\s./ ) {
         $record_id = $1;
     }

Modified: Prophet/trunk/t/simple-push.t
==============================================================================
--- Prophet/trunk/t/simple-push.t	(original)
+++ Prophet/trunk/t/simple-push.t	Sun Apr 13 20:44:46 2008
@@ -9,18 +9,18 @@
     run_ok( 'prophet', [qw(create --type Bug --status new --from alice )], "Created a record as alice" );
     run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/new/], " Found our record" );
 
-    # update the node
-    # show the node history
-    # show the node
+    # update the record
+    # show the record history
+    # show the record
 };
 
 as_bob {
     run_ok( 'prophet', [qw(create --type Bug --status open --from bob )], "Created a record as bob" );
     run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/open/], " Found our record" );
 
-    # update the node
-    # show the node history
-    # show the node
+    # update the record
+    # show the record history
+    # show the record
 
 };
 



More information about the Bps-public-commit mailing list