[Bps-public-commit] r14778 - in Prophet/branches/creator/lib/Prophet: .
sartak at bestpractical.com
sartak at bestpractical.com
Mon Aug 4 21:33:13 EDT 2008
Author: sartak
Date: Mon Aug 4 21:33:13 2008
New Revision: 14778
Modified:
Prophet/branches/creator/lib/Prophet/Replica.pm
Prophet/branches/creator/lib/Prophet/Replica/Native.pm
Log:
Use a named parameter for begin_edit's "source"
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 21:33:13 2008
@@ -296,13 +296,13 @@
my $self = shift;
my $changeset = shift;
- $self->begin_edit($changeset);
+ $self->begin_edit(source => $changeset);
$self->record_changes($changeset);
my $state_handle = $self->state_handle;
my $inside_edit = $state_handle->current_edit ? 1 : 0;
- $state_handle->begin_edit($changeset) unless ($inside_edit);
+ $state_handle->begin_edit(source => $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($changeset);
+ $self->begin_edit(source => $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($changeset) unless ($inside_edit);
+ $self->begin_edit(source => $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 21:33:13 2008
@@ -659,7 +659,11 @@
sub begin_edit {
my $self = shift;
- my $source = shift; # the changeset that we're replaying, if applicable
+ my %args = validate(@_, {
+ source => 0, # the changeset that we're replaying, if applicable
+ });
+
+ my $source = $args{source};
my $creator = $source ? $source->creator : $self->changeset_creator;
my $created = $source && $source->created;
More information about the Bps-public-commit
mailing list