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>
This commit is contained in:
Eric Wong
2007-01-29 18:34:55 -08:00
parent 90c1b15da3
commit f7c3fc4a26

View File

@ -1169,6 +1169,7 @@ sub find_parent_branch {
1, $ed) 1, $ed)
or die "SVN connection failed somewhere...\n"; or die "SVN connection failed somewhere...\n";
} }
print STDERR "Successfully followed parent\n";
$ed->{new_fetch} = 1; $ed->{new_fetch} = 1;
return $self->make_log_entry($rev, [$parent], $ed); return $self->make_log_entry($rev, [$parent], $ed);
} }
@ -2295,9 +2296,6 @@ sub gs_fetch_loop_common {
my ($self, $base, $head, @gs) = @_; my ($self, $base, $head, @gs) = @_;
my $inc = 1000; my $inc = 1000;
my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc); my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
my $err_handler = $SVN::Error::handler;
my $err;
$SVN::Error::handler = sub { ($err) = @_; skip_unknown_revs($err); };
my @paths = @gs == 1 ? ($gs[0]->{path}) : (''); my @paths = @gs == 1 ? ($gs[0]->{path}) : ('');
foreach my $gs (@gs) { foreach my $gs (@gs) {
if (my $last_commit = $gs->last_commit) { if (my $last_commit = $gs->last_commit) {
@ -2307,8 +2305,16 @@ sub gs_fetch_loop_common {
} }
while (1) { while (1) {
my @revs; my @revs;
my $err;
my $err_handler = $SVN::Error::handler;
$SVN::Error::handler = sub {
($err) = @_;
skip_unknown_revs($err);
};
$self->get_log(\@paths, $min, $max, 0, 1, 1, $self->get_log(\@paths, $min, $max, 0, 1, 1,
sub { push @revs, [ dup_changed_paths($_[0]), $_[1] ]; }); sub { push @revs, [ dup_changed_paths($_[0]), $_[1] ]; });
$SVN::Error::handler = $err_handler;
if (! @revs && $err && $max >= $head) { if (! @revs && $err && $max >= $head) {
print STDERR "Branch probably deleted:\n ", print STDERR "Branch probably deleted:\n ",
$err->expanded_message, $err->expanded_message,
@ -2335,7 +2341,6 @@ sub gs_fetch_loop_common {
$max += $inc; $max += $inc;
$max = $head if ($max > $head); $max = $head if ($max > $head);
} }
$SVN::Error::handler = $err_handler;
} }
sub minimize_url { sub minimize_url {