[Bps-public-commit] r14773 - in Prophet/branches/creator/lib/Prophet: .

sartak at bestpractical.com sartak at bestpractical.com
Mon Aug 4 19:43:09 EDT 2008


Author: sartak
Date: Mon Aug  4 19:43:08 2008
New Revision: 14773

Modified:
   Prophet/branches/creator/lib/Prophet/Replica.pm
   Prophet/branches/creator/lib/Prophet/Replica/Native.pm

Log:
When we pull in someone else's changeset, use their creator and created

Modified: Prophet/branches/creator/lib/Prophet/Replica.pm
==============================================================================
--- Prophet/branches/creator/lib/Prophet/Replica.pm	(original)
+++ Prophet/branches/creator/lib/Prophet/Replica.pm	Mon Aug  4 19:43:08 2008
@@ -296,13 +296,13 @@
     my $self      = shift;
     my $changeset = shift;
 
-    $self->begin_edit;
+    $self->begin_edit($changeset);
     $self->record_changes($changeset);
 
     my $state_handle = $self->state_handle;
     my $inside_edit = $state_handle->current_edit ? 1 : 0;
 
-    $state_handle->begin_edit() unless ($inside_edit);
+    $state_handle->begin_edit($changeset) unless ($inside_edit);
     $state_handle->record_integration_of_changeset($changeset);
     $state_handle->commit_edit() unless ($inside_edit);
     $self->_set_original_source_metadata_for_current_edit($changeset);
@@ -771,7 +771,7 @@
 
     return unless $changeset->has_changes;
 
-    $self->begin_edit();
+    $self->begin_edit($changeset);
     $self->record_changes($changeset);
     $res_handle->_record_resolution($_) for $changeset->changes;
     $self->commit_edit();
@@ -813,7 +813,7 @@
     $self->_unimplemented ('record_changes') unless ($self->can_write_changesets);
     eval {
         my $inside_edit = $self->current_edit ? 1 : 0;
-        $self->begin_edit() unless ($inside_edit);
+        $self->begin_edit($changeset) unless ($inside_edit);
         $self->integrate_changes($changeset);
         $self->_after_record_changes($changeset);
         $self->commit_edit() unless ($inside_edit);

Modified: Prophet/branches/creator/lib/Prophet/Replica/Native.pm
==============================================================================
--- Prophet/branches/creator/lib/Prophet/Replica/Native.pm	(original)
+++ Prophet/branches/creator/lib/Prophet/Replica/Native.pm	Mon Aug  4 19:43:08 2008
@@ -659,9 +659,15 @@
 
 sub begin_edit {
     my $self = shift;
+    my $source = shift;
+
+    my $creator = $source ? $source->creator : $self->changeset_creator;
+    my $created = $source && $source->created;
+
     my $changeset = Prophet::ChangeSet->new({
-        creator     => $self->changeset_creator,
         source_uuid => $self->uuid,
+        creator     => $creator,
+        $created ? (created => $created) : (),
     });
     $self->current_edit($changeset);
     $self->current_edit_records([]);



More information about the Bps-public-commit mailing list