[Bps-public-commit] r11267 - in SVN-PropDB: . lib/Prophet lib/Prophet/Sync/Source/SVN

jesse at bestpractical.com jesse at bestpractical.com
Sun Mar 30 02:43:27 EDT 2008


Author: jesse
Date: Sun Mar 30 02:43:26 2008
New Revision: 11267

Modified:
   SVN-PropDB/   (props changed)
   SVN-PropDB/lib/Prophet/Handle.pm
   SVN-PropDB/lib/Prophet/Record.pm
   SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm
   SVN-PropDB/lib/Prophet/Sync/Source/SVN/ReplayEditor.pm

Log:
 r28790 at 68-247-206-137:  jesse | 2008-03-29 20:42:35 -1000
  minor edits from code review with clkao


Modified: SVN-PropDB/lib/Prophet/Handle.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Handle.pm	(original)
+++ SVN-PropDB/lib/Prophet/Handle.pm	Sun Mar 30 02:43:26 2008
@@ -178,7 +178,7 @@
     $self->current_edit->root->make_file($file);
     {
         my $stream = $self->current_edit->root->apply_text( $file, undef );
-        print $stream Dumper( $args{'props'} );
+        # print $stream Dumper( $args{'props'} );
         close $stream;
     }
     $self->_set_node_props(

Modified: SVN-PropDB/lib/Prophet/Record.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Record.pm	(original)
+++ SVN-PropDB/lib/Prophet/Record.pm	Sun Mar 30 02:43:26 2008
@@ -34,8 +34,7 @@
 
 sub new {
     my $class = shift;
-    my $self = {};
-    bless $self, $class;
+    my $self = bless {}, $class;
     my %args = validate(@_, { handle => 1, type => 1});
     $self->$_($args{$_}) for keys(%args);
     return $self;
@@ -60,12 +59,9 @@
 
     $self->uuid($uuid);
 
-
     $self->_canonicalize_props($args{'props'});
     $self->_validate_props($args{'props'}) || return undef;
-
     $self->handle->create_node( props => $args{'props'}, uuid => $self->uuid, type => $self->type);
-
     return $self->uuid;
 }
 

Modified: SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm	(original)
+++ SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm	Sun Mar 30 02:43:26 2008
@@ -71,6 +71,8 @@
 
     my $first_rev = $args{'after'} || 1;
 
+    # XXX TODO we should  be using a svn get_log call here rather than simple iteration
+    # clkao explains that this won't deal cleanly with cases where there are revision "holes"
     for my $rev ( $first_rev .. $self->ra->get_latest_revnum ) {
         # This horrible hack is here because I have no idea how to pass custom variables into the editor
         $Prophet::Sync::Source::SVN::ReplayEditor::CURRENT_REMOTE_REVNO = $rev;
@@ -102,7 +104,7 @@
             my $change = Prophet::Change->new(
                 {   node_type   => $type,
                     node_uuid   => $record,
-                    change_type => $entry->{'paths'}->{$path}->{'fs'}
+                    change_type => $entry->{'paths'}->{$path}->{fs_operation}
                 }
             );
             for my $name ( keys %{ $entry->{'paths'}->{$path}->{prop_deltas} } ) {
@@ -237,6 +239,8 @@
 
 Returns the last changeset id seen from the source identified by $SOURCE_UUID
 
+# XXX TODO, we need to move the code from handle here entirely
+
 =cut
 
 sub last_changeset_from_source {

Modified: SVN-PropDB/lib/Prophet/Sync/Source/SVN/ReplayEditor.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Sync/Source/SVN/ReplayEditor.pm	(original)
+++ SVN-PropDB/lib/Prophet/Sync/Source/SVN/ReplayEditor.pm	Sun Mar 30 02:43:26 2008
@@ -82,7 +82,7 @@
 sub delete_entry { 
     my $self = shift;
     my ($path, $revision, $parent_baton) = (@_);
-    $self->{'paths'}->{$path}->{fs} = 'delete';
+    $self->{'paths'}->{$path}->{fs_operation} = 'delete';
 }
 
 =head2 add_file ($path, $parent_baton, $copy_path, $copy_revision, $file_pool, $file_baton) 
@@ -96,7 +96,7 @@
     my ($path, $parent_baton, $copy_path, $copy_revision, $file_pool, $file_baton) = (@_);
     $self->{'current_file'} = $path;
     $self->{'current_file_base_rev'} = "newly created";
-    $self->{'paths'}->{$path}->{fs} = 'add_file';
+    $self->{'paths'}->{$path}->{fs_operation} = 'add_file';
 }
 
 =head2 add_directory ($path, $parent_baton, $copy_path, $copy_revision, $dir_pool, $child_baton) 
@@ -110,7 +110,7 @@
     my $self = shift;
     my ($path, $parent_baton, $copyfrom_path, $copyfrom_revision, $dir_pool, $child_baton) = (@_);
     push @{$self->{'dir_stack'}}, { path => $path, base_rev => -1 };
-    $self->{'paths'}->{$path}->{fs} = 'add_dir';
+    $self->{'paths'}->{$path}->{fs_operation} = 'add_dir';
 }
 
 
@@ -133,7 +133,7 @@
     my ($stream, $pool);
     my ($rev_fetched, $prev_props)  =  $self->ra->get_file($path, $self->{'revision'}-1, $stream,$pool);
 
-    $self->{'paths'}->{$path}->{fs} = 'update_file';
+    $self->{'paths'}->{$path}->{fs_operation} = 'update_file';
     $self->{'paths'}->{$path}->{prev_properties} = $prev_props;
 }
 



More information about the Bps-public-commit mailing list