[Bps-public-commit] r11714 - in sd/trunk/lib/App/SD/Replica: Hiveminder RT

jesse at bestpractical.com jesse at bestpractical.com
Sun Apr 13 20:43:55 EDT 2008


Author: jesse
Date: Sun Apr 13 20:43:54 2008
New Revision: 11714

Modified:
   sd/trunk/lib/App/SD/Replica/Hiveminder/PullEncoder.pm
   sd/trunk/lib/App/SD/Replica/RT.pm
   sd/trunk/lib/App/SD/Replica/RT/PullEncoder.pm

Log:
node->record

Modified: sd/trunk/lib/App/SD/Replica/Hiveminder/PullEncoder.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/Hiveminder/PullEncoder.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/Hiveminder/PullEncoder.pm	Sun Apr 13 20:43:54 2008
@@ -30,8 +30,8 @@
 
             # In Hiveminder, a changeset has only one change
             $change = Prophet::Change->new(
-                {   node_type   => 'ticket',
-                    node_uuid   => $self->sync_source->uuid_for_remote_id( $args{'task'}->{id} ),
+                {   record_type   => 'ticket',
+                    record_uuid   => $self->sync_source->uuid_for_remote_id( $args{'task'}->{id} ),
                     change_type => 'update_file'
                 }
             );
@@ -50,8 +50,8 @@
 
             # In Hiveminder, a changeset has only one change
             $change = Prophet::Change->new(
-                {   node_type   => 'ticket',
-                    node_uuid   => $self->sync_source->uuid_for_remote_id( $args{'task'}->{'id'} ),
+                {   record_type   => 'ticket',
+                    record_uuid   => $self->sync_source->uuid_for_remote_id( $args{'task'}->{'id'} ),
                     change_type => 'add_file'
                 }
             );
@@ -104,8 +104,8 @@
     my %args = validate( @_, { txn => 1, previous_state => 1, changeset => 1 } );
 
     my $change = Prophet::Change->new(
-        {   node_type   => 'ticket',
-            node_uuid   => $self->sync_source->uuid_for_remote_id( $args{'previous_state'}->{'id'} ),
+        {   record_type   => 'ticket',
+            record_uuid   => $self->sync_source->uuid_for_remote_id( $args{'previous_state'}->{'id'} ),
             change_type => 'add_file'
         }
     );
@@ -131,8 +131,8 @@
     my $self   = shift;
     my %args   = validate( @_, { txn => 1, previous_state => 1, changeset => 1 } );
     my $change = Prophet::Change->new(
-        {   node_type => 'comment',
-            node_uuid =>
+        {   record_type => 'comment',
+            record_uuid =>
                 $self->sync_source->uuid_for_url( $self->sync_source->rt_url . "/transaction/" . $args{'txn'}->{'id'} ),
             change_type => 'add_file'
         }
@@ -226,7 +226,7 @@
     my $changeset = shift;
 
     for my $change ( $changeset->changes ) {
-        next unless $change->node_type eq 'ticket';
+        next unless $change->record_type eq 'ticket';
         my @new_props;
         for my $prop ( $change->prop_changes ) {
             $prop->name( $PROP_MAP{ lc( $prop->name ) } ) if $PROP_MAP{ lc( $prop->name ) };

Modified: sd/trunk/lib/App/SD/Replica/RT.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/RT.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/RT.pm	Sun Apr 13 20:43:54 2008
@@ -204,15 +204,15 @@
     my ( $change, $changeset ) = validate_pos( @_, { isa => 'Prophet::Change' }, { isa => 'Prophet::ChangeSet' } );
     my $id;
     eval {
-        if ( $change->node_type eq 'ticket' and $change->change_type eq 'add_file' )
+        if ( $change->record_type eq 'ticket' and $change->change_type eq 'add_file' )
         {
             $id = $self->integrate_ticket_create( $change, $changeset );
-            $self->record_pushed_ticket( uuid => $change->node_uuid, remote_id => $id );
+            $self->record_pushed_ticket( uuid => $change->record_uuid, remote_id => $id );
 
-        } elsif ( $change->node_type eq 'comment' ) {
+        } elsif ( $change->record_type eq 'comment' ) {
 
             $id = $self->integrate_comment( $change, $changeset );
-        } elsif ( $change->node_type eq 'ticket' ) {
+        } elsif ( $change->record_type eq 'ticket' ) {
             $id = $self->integrate_ticket_update( $change, $changeset );
 
         } else {
@@ -232,7 +232,7 @@
     my ( $change, $changeset ) = validate_pos( @_, { isa => 'Prophet::Change' }, { isa => 'Prophet::ChangeSet' } );
 
     # Figure out the remote site's ticket ID for this change's record
-    my $remote_ticket_id = $self->remote_id_for_uuid( $change->node_uuid );
+    my $remote_ticket_id = $self->remote_id_for_uuid( $change->record_uuid );
     my $ticket           = RT::Client::REST::Ticket->new(
         rt => $self->rt,
         id => $remote_ticket_id,

Modified: sd/trunk/lib/App/SD/Replica/RT/PullEncoder.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/RT/PullEncoder.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/RT/PullEncoder.pm	Sun Apr 13 20:43:54 2008
@@ -88,8 +88,8 @@
     my %args = validate( @_, { ticket => 1, txn => 1, create_state => 1, changeset => 1 } );
 
     my $change = Prophet::Change->new(
-        {   node_type   => 'ticket',
-            node_uuid   => $self->sync_source->uuid_for_remote_id( $args{'create_state'}->{'id'} ),
+        {   record_type   => 'ticket',
+            record_uuid   => $self->sync_source->uuid_for_remote_id( $args{'create_state'}->{'id'} ),
             change_type => 'update_file'
         }
     );
@@ -136,8 +136,8 @@
     my %args = validate( @_, { ticket => 1, txn => 1, create_state => 1, changeset => 1 } );
 
     my $change = Prophet::Change->new(
-        {   node_type   => 'ticket',
-            node_uuid   => $self->sync_source->uuid_for_remote_id( $args{'create_state'}->{'id'} ),
+        {   record_type   => 'ticket',
+            record_uuid   => $self->sync_source->uuid_for_remote_id( $args{'create_state'}->{'id'} ),
             change_type => 'add_file'
         }
     );
@@ -170,8 +170,8 @@
     );
 
     my $change = Prophet::Change->new(
-        {   node_type   => 'ticket',
-            node_uuid   => $self->sync_source->uuid_for_remote_id( $args{'create_state'}->{'id'} ),
+        {   record_type   => 'ticket',
+            record_uuid   => $self->sync_source->uuid_for_remote_id( $args{'create_state'}->{'id'} ),
             change_type => 'update_file'
         }
     );
@@ -188,8 +188,8 @@
     my $self   = shift;
     my %args   = validate( @_, { ticket => 1, txn => 1, create_state => 1, changeset => 1 } );
     my $change = Prophet::Change->new(
-        {   node_type => 'comment',
-            node_uuid =>
+        {   record_type => 'comment',
+            record_uuid =>
                 $self->sync_source->uuid_for_url( $self->sync_source->rt_url . "/transaction/" . $args{'txn'}->{'id'} ),
             change_type => 'add_file'
         }
@@ -236,8 +236,8 @@
     );
 
     my $change = Prophet::Change->new(
-        {   node_type   => 'ticket',
-            node_uuid   => $self->sync_source->uuid_for_remote_id( $args{'create_state'}->{'id'} ),
+        {   record_type   => 'ticket',
+            record_uuid   => $self->sync_source->uuid_for_remote_id( $args{'create_state'}->{'id'} ),
             change_type => 'update_file'
         }
     );
@@ -278,8 +278,8 @@
     );
 
     my $change = Prophet::Change->new(
-        {   node_type   => 'ticket',
-            node_uuid   => $self->sync_source->uuid_for_remote_id( $args{'create_state'}->{'id'} ),
+        {   record_type   => 'ticket',
+            record_uuid   => $self->sync_source->uuid_for_remote_id( $args{'create_state'}->{'id'} ),
             change_type => 'update_file'
         }
     );
@@ -373,7 +373,7 @@
     my $changeset = shift;
 
     for my $change ( $changeset->changes ) {
-        next unless $change->node_type eq 'ticket';
+        next unless $change->record_type eq 'ticket';
 
         my @new_props;
         for my $prop ( $change->prop_changes ) {



More information about the Bps-public-commit mailing list