diff options
author | Matthias Urlichs <smurf@smurf.noris.de> | 2005-10-10 14:14:44 +0200 |
---|---|---|
committer | Matthias Urlichs <smurf@smurf.noris.de> | 2005-10-10 14:14:44 +0200 |
commit | 8cd4177d5ef651c8acb9c1f113a076e6fae2e1c2 (patch) | |
tree | e2052381ade826a6a97c52d1bd840abae519db0f /git-svnimport.perl | |
parent | 37dcf6de60498dfedb5d97ad96789b0527493bcd (diff) | |
download | git-8cd4177d5ef651c8acb9c1f113a076e6fae2e1c2.tar.gz |
svn import: avoid reconnecting
Perl's eval() sets $@ to empts, not undef, when it succeeds.
That caused excessive reconnect attempts.
Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
Diffstat (limited to 'git-svnimport.perl')
-rwxr-xr-x | git-svnimport.perl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/git-svnimport.perl b/git-svnimport.perl index ef73f364cc..ba9f818a06 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -100,8 +100,6 @@ sub new { $self->{'fullrep'} = $repo; $self->conn(); - $self->{'lines'} = undef; - return $self; } @@ -112,6 +110,7 @@ sub conn { die "SVN connection to $repo: $!\n" unless defined $s; $self->{'svn'} = $s; + print STDERR "*** SVN *** $s ***\n"; $self->{'repo'} = $repo; $self->{'maxrev'} = $s->get_latest_revnum(); } @@ -124,13 +123,15 @@ sub file { DIR => File::Spec->tmpdir(), UNLINK => 1); print "... $rev $path ...\n" if $opt_v; - eval { $self->{'svn'}->get_file($path,$rev,$fh); }; - if (defined $@ and $@ !~ /Attempted to get checksum/) { + my $s = $self->{'svn'}; + print STDERR "*** GET *** $s ***\n"; + eval { $s->get_file($path,$rev,$fh); }; + if ($@ and $@ !~ /Attempted to get checksum/) { # retry $self->conn(); eval { $self->{'svn'}->get_file($path,$rev,$fh); }; }; - return () if defined $@ and $@ !~ /Attempted to get checksum/; + return () if $@ and $@ !~ /Attempted to get checksum/; die $@ if $@; close ($fh); |