X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=git-svnimport.perl;h=20a85724cb1660a3411fa34717cd5f1e98ebd731;hb=8d7d1670a87743c699aa8a981506c952088dc2d4;hp=aa8fa404e65756038411662bd3b0a643d85d6034;hpb=0090a6185af18a199d5bc12781adf411177f1e1a;p=git.git diff --git a/git-svnimport.perl b/git-svnimport.perl index aa8fa404..20a85724 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -108,7 +108,7 @@ sub conn { sub file { my($self,$path,$rev) = @_; - my ($fh, $name) = tempfile('gitsvn.XXXXXX', + my ($fh, $name) = tempfile('gitsvn.XXXXXX', DIR => File::Spec->tmpdir(), UNLINK => 1); print "... $rev $path ...\n" if $opt_v; @@ -163,9 +163,9 @@ sub getwd() { sub get_headref($$) { my $name = shift; - my $git_dir = shift; + my $git_dir = shift; my $sha; - + if (open(C,"$git_dir/refs/heads/$name")) { chomp($sha = ); close(C); @@ -235,7 +235,7 @@ EOM $forward_master = $opt_o ne 'master' && -f "$git_dir/refs/heads/master" && - system('cmp', '-s', "$git_dir/refs/heads/master", + system('cmp', '-s', "$git_dir/refs/heads/master", "$git_dir/refs/heads/$opt_o") == 0; # populate index @@ -285,8 +285,8 @@ sub get_file($$$) { $res = $lwp_ua->request($req); if ($res->is_success) { my $fh; - ($fh, $name) = tempfile('gitsvn.XXXXXX', - DIR => File::Spec->tmpdir(), UNLINK => 1); + ($fh, $name) = tempfile('gitsvn.XXXXXX', + DIR => File::Spec->tmpdir(), UNLINK => 1); print $fh $res->content; close($fh) or die "Could not write $name: $!\n"; } else { @@ -352,7 +352,7 @@ sub copy_subdir($$$$$$) { print "... found $path$p ...\n" if $opt_v; push(@$new,[$mode,$sha1,$path.$p]); } - close($f) or + close($f) or print STDERR "$newrev:$newbranch: could not list files in $oldpath \@ $rev\n"; } @@ -567,7 +567,7 @@ sub commit { push @par, '-p', $mparent; print OUT "Merge parent branch: $mparent\n" if $opt_v; } - } + } } exec("env", @@ -604,7 +604,7 @@ sub commit { print "... no known parent\n" if $opt_v; } elsif(not $tag) { print "Writing to refs/heads/$dest\n" if $opt_v; - open(C,">$git_dir/refs/heads/$dest") and + open(C,">$git_dir/refs/heads/$dest") and print C ("$cid\n") and close(C) or die "Cannot write branch $dest for update: $!\n"; @@ -614,7 +614,7 @@ sub commit { my($in, $out) = ('',''); $last_rev = "-" if %$changed_paths; # the tag was 'complex', i.e. did not refer to a "real" revision - + $dest =~ tr/_/\./ if $opt_u; my $pid = open2($in, $out, 'git-mktag'); @@ -677,7 +677,8 @@ while(++$current_rev <= $svn->{'maxrev'}) { $svn->{'svn'}->get_log("/",$current_rev,$current_rev,$current_rev,1,1,\&_commit_all,""); commit_all(); if($opt_l and not --$opt_l) { - print STDERR "Exiting due to a memory leak. Repeat, please.\n"; + print STDERR "Stopping, because there is a memory leak (in the SVN library).\n"; + print STDERR "Please repeat this command; it will continue safely\n"; last; } }