[Bps-public-commit] r11548 - in SVN-PropDB/lib/Prophet: . Handle
clkao at bestpractical.com
clkao at bestpractical.com
Sat Apr 5 18:48:53 EDT 2008
Author: clkao
Date: Sat Apr 5 18:48:51 2008
New Revision: 11548
Modified:
SVN-PropDB/lib/Prophet/ForeignReplica.pm
SVN-PropDB/lib/Prophet/Handle/SVN.pm
SVN-PropDB/lib/Prophet/Replica.pm
SVN-PropDB/lib/Prophet/Replica/SVN.pm
Log:
now all merge ticket logic (on state_handle) should be move to
base replica.
Modified: SVN-PropDB/lib/Prophet/ForeignReplica.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/ForeignReplica.pm (original)
+++ SVN-PropDB/lib/Prophet/ForeignReplica.pm Sat Apr 5 18:48:51 2008
@@ -19,35 +19,14 @@
sub accepts_changesets {1}
sub import_resolutions_from_remote_source { warn 'no resdb'; return }
-
-
sub record_changeset {
my $self = shift;
my ($changeset) = validate_pos( @_, { isa => 'Prophet::ChangeSet' } );
for my $change ( $changeset->changes ) {
my $result = $self->_integrate_change( $change, $changeset );
}
-
}
-sub record_integration_changeset {
- warn "record_integration_changeset should be renamed to 'record_original_change";
- my ( $self, $changeset ) = @_;
- $self->record_changeset($changeset);
-
- # XXX: this can now be back in the base class and always record in state_handle sanely
- # does the merge ticket recording & _source_metadata (book keeping for what txns in rt we just created)
-
- $self->state_handle->begin_edit;
- $self->state_handle->record_changeset_integration($changeset);
- $self->state_handle->commit_edit;
-
- return;
-}
-
-
-
-
use Data::UUID 'NameSpace_DNS';
sub uuid_for_url {
Modified: SVN-PropDB/lib/Prophet/Handle/SVN.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Handle/SVN.pm (original)
+++ SVN-PropDB/lib/Prophet/Handle/SVN.pm Sat Apr 5 18:48:51 2008
@@ -77,9 +77,9 @@
sub record_changeset_integration {
my $self = shift;
- my ($changeset) = validate_pos( @_, { isa => 'Prophet::ChangeSet' } );
-
- $self->_set_original_source_metadata($changeset);
+ my ($changeset) = validate_pos( @_, { isa => 'Prophet::ChangeSet' } );
+
+ $self->_set_original_source_metadata($changeset);
return $self->SUPER::record_changeset_integration($changeset);
}
Modified: SVN-PropDB/lib/Prophet/Replica.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica.pm (original)
+++ SVN-PropDB/lib/Prophet/Replica.pm Sat Apr 5 18:48:51 2008
@@ -193,6 +193,7 @@
}
=head2 record_changeset
+
=cut
sub record_changeset {
@@ -204,7 +205,19 @@
=cut
sub record_integration_changeset {
- die ref( $_[0] ) . ' must implement record_changeset';
+ my $self = shift;
+ my $changeset = shift;
+
+ $self->record_changeset($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->record_changeset_integration($changeset);
+ $state_handle->commit_edit() unless ($inside_edit);
+
+ return;
}
Modified: SVN-PropDB/lib/Prophet/Replica/SVN.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica/SVN.pm (original)
+++ SVN-PropDB/lib/Prophet/Replica/SVN.pm Sat Apr 5 18:48:51 2008
@@ -147,7 +147,9 @@
sub record_integration_changeset {
my $self = shift;
- $self->prophet_handle->integrate_changeset(@_);
+ $self->prophet_handle->begin_edit;
+ $self->SUPER::record_integration_changeset(@_);
+ $self->prophet_handle->commit_edit;
}
sub record_changeset {
@@ -155,10 +157,6 @@
$self->prophet_handle->record_changeset(@_);
}
-
-
-
-
sub record_resolutions {
my $self = shift;
$self->prophet_handle->record_resolutions( @_,
More information about the Bps-public-commit
mailing list