[Bps-public-commit] r11541 - in SVN-PropDB: . doc lib/Prophet/Handle
jesse at bestpractical.com
jesse at bestpractical.com
Sat Apr 5 17:41:25 EDT 2008
Author: jesse
Date: Sat Apr 5 17:41:22 2008
New Revision: 11541
Modified:
SVN-PropDB/ (props changed)
SVN-PropDB/doc/todo
SVN-PropDB/lib/Prophet/Handle.pm
SVN-PropDB/lib/Prophet/Handle/SVN.pm
Log:
r29248 at 31b: jesse | 2008-04-05 11:41:03 -1000
* Refactor svn handle specific backend stuff to the SVN handle type
Modified: SVN-PropDB/doc/todo
==============================================================================
--- SVN-PropDB/doc/todo (original)
+++ SVN-PropDB/doc/todo Sat Apr 5 17:41:22 2008
@@ -9,15 +9,7 @@
- prophet::record: get_logs/youngest_rev/reivision_root/node_proplist
- prophet::handle: revision_root, current_edit
- prophet::test : youngest_rev
- - move {begin,end}_edit, node* methods into repo handler (Prophet::Handle::SVN) ?
- record_resolution & other friends belong higher level than actual storage, ditto for record_changeset,
- node* and edit* functions are needed from the storage layer
- rebless is probbly good for now, i will work on the callers that creates proper handles.
-
- - what if we move them to ..no. moving them to ::Replica::SVN is wrong.
-
- - Should I start on that and make Handle->new() rebless to handle::svn new for now?
-
+ - move {begin,end}_edit, node* methods into repo handler (Prophet::Handle::SVN) ? @done
Modified: SVN-PropDB/lib/Prophet/Handle.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Handle.pm (original)
+++ SVN-PropDB/lib/Prophet/Handle.pm Sat Apr 5 17:41:22 2008
@@ -40,11 +40,6 @@
$self->begin_edit();
$self->record_changeset($changeset);
-
- $self->_set_original_source_metadata($changeset);
- warn "to commit... " if ($DEBUG);
- my $changed = $self->current_edit->root->paths_changed;
- warn Dumper($changed) if ($DEBUG);
$self->record_changeset_integration($changeset);
$self->commit_edit();
}
@@ -58,11 +53,6 @@
$self->begin_edit();
$self->record_changeset($changeset);
-
- warn "to commit... " if ($DEBUG);
- my $changed = $self->current_edit->root->paths_changed;
- warn Dumper($changed) if ($DEBUG);
-
$res_handle->record_resolution($_) for $changeset->changes;
$self->commit_edit();
}
@@ -100,21 +90,14 @@
my $inside_edit = $self->current_edit ? 1 : 0;
$self->begin_edit() unless ($inside_edit);
$self->_integrate_change($_) for ( $changeset->changes );
- $self->current_edit->change_prop( 'prophet:special-type' => 'nullification' )
- if ( $changeset->is_nullification );
- $self->current_edit->change_prop( 'prophet:special-type' => 'resolution' ) if ( $changeset->is_resolution );
+ $self->_cleanup_integrated_changeset($changeset);
+
+
$self->commit_edit() unless ($inside_edit);
};
die($@) if ($@);
}
-sub _set_original_source_metadata {
- my $self = shift;
- my $change = shift;
-
- $self->current_edit->change_prop( 'prophet:original-source' => $change->original_source_uuid );
- $self->current_edit->change_prop( 'prophet:original-sequence-no' => $change->original_sequence_no );
-}
sub _integrate_change {
my $self = shift;
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 17:41:22 2008
@@ -65,6 +65,35 @@
$self->_create_nonexistent_dir( $self->db_root );
}
+
+sub _cleanup_integrated_changeset{
+ my $self = shift;
+ my ($changeset) = validate_pos(@_, { isa => 'Prophet::ChangeSet'});
+
+ $self->current_edit->change_prop( 'prophet:special-type' => 'nullification' ) if ( $changeset->is_nullification );
+ $self->current_edit->change_prop( 'prophet:special-type' => 'resolution' ) if ( $changeset->is_resolution );
+}
+
+
+sub record_changeset_integration {
+ my $self = shift;
+ my ($changeset) = validate_pos( @_, { isa => 'Prophet::ChangeSet' } );
+
+ $self->_set_original_source_metadata($changeset);
+ return $self->SUPER::record_changeset_integration($changeset);
+
+}
+
+
+sub _set_original_source_metadata {
+ my $self = shift;
+ my ($changeset) = validate_pos( @_, { isa => 'Prophet::ChangeSet' } );
+
+ $self->current_edit->change_prop( 'prophet:original-source' => $changeset->original_source_uuid );
+ $self->current_edit->change_prop( 'prophet:original-sequence-no' => $changeset->original_sequence_no );
+}
+
+
sub _create_nonexistent_dir {
my $self = shift;
my $dir = shift;
More information about the Bps-public-commit
mailing list