Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  git-svn: avoid fetching files twice in the same revision
  • Loading branch information
Junio C Hamano committed Dec 3, 2006
2 parents 3683dc5 + 6173c19 commit 278fcd7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2982,7 +2982,7 @@ sub libsvn_fetch_delta {
sub libsvn_fetch_full {
my ($last_commit, $paths, $rev, $author, $date, $msg) = @_;
open my $gui, '| git-update-index -z --index-info' or croak $!;
my @amr;
my %amr;
my $p = $SVN->{svn_path};
foreach my $f (keys %$paths) {
my $m = $paths->{$f}->action();
Expand All @@ -3001,21 +3001,21 @@ sub libsvn_fetch_full {
my $t = $SVN->check_path($f, $rev, $pool);
if ($t == $SVN::Node::file) {
if ($m =~ /^[AMR]$/) {
push @amr, [ $m, $f ];
$amr{$f} = $m;
} else {
die "Unrecognized action: $m, ($f r$rev)\n";
}
} elsif ($t == $SVN::Node::dir && $m =~ /^[AR]$/) {
my @traversed = ();
libsvn_traverse($gui, '', $f, $rev, \@traversed);
foreach (@traversed) {
push @amr, [ $m, $_ ]
$amr{$_} = $m;
}
}
$pool->clear;
}
foreach (@amr) {
libsvn_get_file($gui, $_->[1], $rev, $_->[0]);
foreach (keys %amr) {
libsvn_get_file($gui, $_, $rev, $amr{$_});
}
close $gui or croak $?;
return libsvn_log_entry($rev, $author, $date, $msg, [$last_commit]);
Expand Down

0 comments on commit 278fcd7

Please sign in to comment.