summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eaf718f)
raw | patch | inline | side by side (parent: eaf718f)
author | Matthias Urlichs <smurf@smurf.noris.de> | |
Mon, 10 Oct 2005 10:33:22 +0000 (12:33 +0200) | ||
committer | Matthias Urlichs <smurf@smurf.noris.de> | |
Mon, 10 Oct 2005 10:33:22 +0000 (12:33 +0200) |
Trying to downlaod a file that's really a subdirectory doesn't work too well.
Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
git-svnimport.perl | patch | blob | history |
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 08645f7ebb6f2cf1e4825d1be0eaac14e23d4006..920b23e6cb998d130be8d6e246a46c057dfcc317 100755 (executable)
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
my ($fh, $name) = tempfile('gitsvn.XXXXXX',
DIR => File::Spec->tmpdir(), UNLINK => 1);
- $self->{'svn'}->get_file($path,$rev,$fh) or do {
+ print "... $rev $path ...\n" if $opt_v;
+ eval { $self->{'svn'}->get_file($path,$rev,$fh); };
+ if (defined $@ and $@ !~ /Attempted to get checksum/) {
# retry
$self->conn();
- $self->{'svn'}->get_file($path,$rev,$fh)
- or die "$rev: No file $path at $rev\n";
+ eval { $self->{'svn'}->get_file($path,$rev,$fh); };
};
+ return () if defined $@ and $@ !~ /Attempted to get checksum/;
+ die $@ if $@;
close ($fh);
return ($name, $res);
}
# now get it
- my ($name, $res) = $svn->file($svnpath,$rev);
+ my ($name, $res) = eval { $svn->file($svnpath,$rev); };
+ return () unless defined $name;
open my $F, '-|', "git-hash-object -w $name"
or die "Cannot create object: $!\n";
my($author_name,$author_email,$dest);
my(@old,@new);
- if ($author =~ /^(.*?)\s+<(.*)>$/) {
+ if (not defined $author) {
+ $author_name = $author_email = "unknown";
+ } elsif ($author =~ /^(.*?)\s+<(.*)>$/) {
($author_name, $author_email) = ($1, $2);
} else {
$author =~ s/^<(.*)>$/$1/;