[svk-commit] r2109 - in branches/mirror-pipeline/lib/SVK: Editor

clkao at bestpractical.com clkao at bestpractical.com
Sat Nov 4 17:32:42 EST 2006


Author: clkao
Date: Sat Nov  4 17:32:35 2006
New Revision: 2109

Modified:
   branches/mirror-pipeline/lib/SVK/Editor/Serialize.pm
   branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNSync.pm

Log:
misc cleanups.

Modified: branches/mirror-pipeline/lib/SVK/Editor/Serialize.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Editor/Serialize.pm	(original)
+++ branches/mirror-pipeline/lib/SVK/Editor/Serialize.pm	Sat Nov  4 17:32:35 2006
@@ -11,8 +11,6 @@
     my $baton;
     pop @arg if ref ($arg[-1]) =~ m/^(?:SVN::Pool|_p_apr_pool_t)$/;
 
-    warn "==> starting " if $func eq 'open_root';
-
     if ((my $baton_at = $self->baton_at ($func)) >= 0) {
 	$baton = $arg[$baton_at];
     }

Modified: branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNSync.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNSync.pm	(original)
+++ branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNSync.pm	Sat Nov  4 17:32:35 2006
@@ -123,7 +123,6 @@
     );
 }
 
-use Digest::MD5 'md5_hex';
 sub emit {
     my ($self, $editor, $func, $pool, @arg) = @_;
     my ($ret, $baton_at);
@@ -153,12 +152,11 @@
     return \$msg;
 }
 
-my $baton_map = {};
-my $baton_pool = {};
-
 sub _read_evil_replay {
     my ($self, $editor, $fh) = @_;
-    my $pool;
+    my $baton_map = {};
+    my $baton_pool = {};
+
     while (my $data = read_msg($fh)) {
 	my $x = thaw($$data);
 	my ($next, $func, @arg) = @$x;
@@ -168,7 +166,7 @@
 	    $arg[$baton_at] = $baton_map->{$baton};
 	}
 
-	my $ret = $self->emit($editor, $func, $pool, @arg);
+	my $ret = $self->emit($editor, $func, undef, @arg);
 
 	last if $func eq 'close_edit';
 
@@ -263,8 +261,7 @@
 
     }
     my $i = 0;
-    while ( 
-	    $#{$buf} >= 0 || length($unsent_buf) ) {
+    while ( $#{$buf} >= 0 || length($unsent_buf) ) {
 	if (my $len = length $unsent_buf) {
 	    if (my $ret = syswrite($fh, $unsent_buf)) {
 		substr($unsent_buf, 0, $ret, '');
@@ -316,12 +313,10 @@
     while (my $changeset = $gen->()) {
 	$pool->clear;
 	while ($current_editors > $max_editor_in_buf) {
-	    warn "waiting for flush for $changeset.. ($current_editors).";
 	    try_flush($p, 1);
 	}
 
 	++$current_editors;
-	warn "replay $changeset ($current_editors)";
 	$ra->replay($changeset, 0, 1,# SVK::Editor->new(_debug=>1));
 		    SVK::Editor::Serialize->new({ cb_serialize_entry =>
 						  sub { entry(@_); try_flush($p) } }));


More information about the svk-commit mailing list