Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
svn import: avoid reconnecting
author
Matthias Urlichs
<smurf@smurf.noris.de>
Mon, 10 Oct 2005 12:14:44 +0000
(14:14 +0200)
committer
Matthias Urlichs
<smurf@smurf.noris.de>
Mon, 10 Oct 2005 12:14:44 +0000
(14:14 +0200)
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>
git-svnimport.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
37dcf6d
)
diff --git
a/git-svnimport.perl
b/git-svnimport.perl
index ef73f364cc420fd1d570ec781b4e987ceb2b9bc1..ba9f818a06341a414eb8d21fa8ad29d225895f20 100755
(executable)
--- a/
git-svnimport.perl
+++ b/
git-svnimport.perl
@@
-100,8
+100,6
@@
sub new {
$self->{'fullrep'} = $repo;
$self->conn();
$self->{'fullrep'} = $repo;
$self->conn();
- $self->{'lines'} = undef;
-
return $self;
}
return $self;
}
@@
-112,6
+110,7
@@
sub conn {
die "SVN connection to $repo: $!\n" unless defined $s;
$self->{'svn'} = $s;
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();
}
$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;
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); };
};
# 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);
die $@ if $@;
close ($fh);