git-svn: reinstate the default SVN error handler after using get_log
We don't need our own error handler for other operations. Also add a message about the successfully do_switch or do_update in follow-parent for debugging do_switch failures with svn:// and svn+ssh:// connections. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong committed
Jan 29, 2007 at 18:34 UTC
f7c3fc4a269ad4f12cc9d97d70e46ba3d5dfdb79
1 file changed
+9
-4
git-svn.perl
+9
-4
@@ -1169,6 +1169,7 @@ sub find_parent_branch {
1169
1, $ed)
1170
or die "SVN connection failed somewhere...\n";
1171
}
1172
+ print STDERR "Successfully followed parent\n";
1173
$ed->{new_fetch} = 1;
1174
return $self->make_log_entry($rev, [$parent], $ed);
1175
}
@@ -2295,9 +2296,6 @@ sub gs_fetch_loop_common {
2296
my ($self, $base, $head, @gs) = @_;
2297
my $inc = 1000;
2298
my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
2298
- my $err_handler = $SVN::Error::handler;
2299
- my $err;
2300
- $SVN::Error::handler = sub { ($err) = @_; skip_unknown_revs($err); };
2299
my @paths = @gs == 1 ? ($gs[0]->{path}) : ('');
2300
foreach my $gs (@gs) {
2301
if (my $last_commit = $gs->last_commit) {
@@ -2307,8 +2305,16 @@ sub gs_fetch_loop_common {
2305
}
2306
while (1) {
2307
my @revs;
2308
+ my $err;
2309
+ my $err_handler = $SVN::Error::handler;
2310
+ $SVN::Error::handler = sub {
2311
+ ($err) = @_;
2312
+ skip_unknown_revs($err);
2313
+ };
2314
$self->get_log(\@paths, $min, $max, 0, 1, 1,
2315
sub { push @revs, [ dup_changed_paths($_[0]), $_[1] ]; });
2316
+ $SVN::Error::handler = $err_handler;
2317
+
2318
if (! @revs && $err && $max >= $head) {
2319
print STDERR "Branch probably deleted:\n ",
2320
$err->expanded_message,
@@ -2335,7 +2341,6 @@ sub gs_fetch_loop_common {
2341
$max += $inc;
2342
$max = $head if ($max > $head);
2343
}
2338
- $SVN::Error::handler = $err_handler;
2344
}
2345
2346
sub minimize_url {