[Bps-public-commit] r10968 - in SVN-PropDB: bin

jesse at bestpractical.com jesse at bestpractical.com
Sun Mar 2 01:12:15 EST 2008


Author: jesse
Date: Sun Mar  2 01:12:14 2008
New Revision: 10968

Added:
   SVN-PropDB/bin/svn-replay
Modified:
   SVN-PropDB/   (props changed)
   SVN-PropDB/notes

Log:
 r28025 at 31b:  jesse | 2008-03-02 01:12:03 -0500
 checkpointing the svn replay tool


Added: SVN-PropDB/bin/svn-replay
==============================================================================
--- (empty file)
+++ SVN-PropDB/bin/svn-replay	Sun Mar  2 01:12:14 2008
@@ -0,0 +1,145 @@
+#!/usr/bin/perl -w
+use strict;
+use SVN::Core;
+use SVN::Ra;
+use SVK;
+use SVK::Config;
+
+my $pool = SVN::Pool->new_default;
+my ($baton, $ref) = SVN::Core::auth_open_helper(SVK::Config->get_auth_providers);
+my $config = SVK::Config->svnconfig;
+my $url = shift;
+my $ra = SVN::Ra->new( url => $url || 'https://svn.apache.org/repos/asf/incubator', config => $config, auth => $baton);
+use SVN::Delta;
+$ra->reparent($url);
+#"https://svn.apache.org/repos/asf/incubator/servicemix/branches/servicemix-4.0");
+#warn $ra->get_dir('', shift || 595538);
+
+my $last_child =  $ra->get_latest_revnum;
+
+
+        my $handle_replayed_txn = sub {
+            use YAML;
+            warn "Asked to replya a txn with args ". YAML::Dump(\@_);
+
+            Prophet::SVN::Delta::Editor::Replay->new(
+                _editor => [ Prophet::SVN::Delta::Editor::Replay->new ],
+                _debug  => 1
+            );
+        };
+
+for ( 1 .. $last_child ) {
+    warn "Now fetching remote rev " . $_;
+
+    warn $ra->replay( $_, 0, 0, $handle_replayed_txn->());
+
+}
+
+package Prophet::SVN::Delta::Editor::Replay;
+use base qw/SVN::Delta::Editor/;
+
+sub apply {
+    my $self = shift;
+    warn "In apply: ";  warn YAML::Dump(\@_)};
+
+sub open_root {
+    my $self = shift;
+    my ($edit_baton, $base_rev, $dir_pool, $root_baton) = (@_);
+    warn "opening the root (it was changed in $base_rev)" ;
+}
+
+sub open_directory { 
+    my $self = shift;
+    my ($path, $parent_baton, $base_rev, $dir_pool, $child_baton) = (@_);
+    
+    warn "open_directory $path (last rev was $base_rev)";
+}
+sub delete_entry { 
+    my $self = shift;
+    my ($path, $revision, $parent_baton) = (@_);
+    warn "Deleting $path (last changed as of $revision)";
+}
+
+sub add_file { 
+    my $self = shift;
+    warn "Adding a file";
+    my ($path, $parent_baton, $copy_path, $copy_revision, $file_pool, $file_baton) = (@_);
+    warn "$path - (Copied from $copy_path as of $copy_revision)";
+}
+
+sub add_directory {
+    my $self = shift;
+    my ($path, $parent_baton, $copyfrom_path, $copyfrom_revision, $dir_pool, $child_baton) = (@_);
+    warn "Added a new directory - $path. It came from $copyfrom_path as of $copyfrom_revision";
+}
+
+sub open_file {
+    my $self = shift;
+    my ($path, $parent_baton, $base_rev, $file_pool, $file_baton) = (@_);
+
+
+    warn "Opening a file for editing: $path. (The previous rev was $base_rev)";
+
+}
+sub close_file {
+    my $self = shift;
+    my ($file_baton, $text_checksum, $pool) = (@_);
+    #  warn " Done with the file edit";
+
+}
+
+sub absent_file {
+    my $self = shift;
+    my ($file_baton, $text_checksum, $pool) = (@_);
+    warn "We aren't allowed to see this file for some reason. maybe authz";
+
+
+}
+
+sub close_directory {
+    my $self = shift;
+    #warn "Done with the directory";
+    my ($dir_baton, $pool) = (@_);
+
+}
+
+sub absent_directory {
+    my $self = shift;
+    my ($path, $parent_baton, $pool) = (@_);
+    warn" We can't see this directory ($path) because of something (maybe authz)";
+}
+
+sub xx_apply_textdelta {
+    my $self = shift;
+    my ($base_checksum, $pool, $window_handler, $handler_baton) = (@_);;
+    warn "Applying a text delta to the file";
+}
+sub change_file_prop {
+    my $self = shift;
+    warn Dumper(\@_); use Data::Dumper;
+    my ($file_baton, $name, $value, $pool) = (@_);
+    warn "Changing the props for this file";
+    warn "$name -> $value";
+
+}
+sub change_dir_prop {
+    my $self = shift;
+    my ($dir_baton, $name, $value, $pool) = (@_);
+    warn "Changing the props for this directory: $name -> $value";
+
+}
+
+sub set_target_revision {
+    my $self = shift;
+    my ($edit_baton, $target_revnum, $pool) = (@_);
+    warn "Set a target revision of $target_revnum";
+
+}
+
+sub close_edit {
+    my $self = shift;
+    my ($edit_baton, $pool) = (@_); 
+    #return "Done with this edit";
+}
+1;
+

Modified: SVN-PropDB/notes
==============================================================================
--- SVN-PropDB/notes	(original)
+++ SVN-PropDB/notes	Sun Mar  2 01:12:14 2008
@@ -185,6 +185,7 @@
 
 I'll commit this file
 
+enjoy the hacking. ->irc
 
 
 



More information about the Bps-public-commit mailing list