Skip to content

Commit a51cdb0

Browse files
Eric Wonggitster
authored andcommitted
git-svn: fix "Malformed network data" with svn:// servers
We have a workaround for the reparent function not working correctly on the SVN native protocol servers. This workaround opens a new connection (SVN::Ra object) to the new URL/directory. Since libsvn appears limited to only supporting one connection at a time, this workaround invalidates the Git::SVN::Ra object that is $self inside gs_fetch_loop_common(). So we need to restart that connection once all the fetching is done for each loop iteration to be able to run get_log() successfully. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ee834cf commit a51cdb0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

git-svn.perl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3013,7 +3013,7 @@ package Git::SVN::Ra;
30133013
use vars qw/@ISA $config_dir $_log_window_size/;
30143014
use strict;
30153015
use warnings;
3016-
my ($can_do_switch, %ignored_err, $RA);
3016+
my ($ra_invalid, $can_do_switch, %ignored_err, $RA);
30173017

30183018
BEGIN {
30193019
# enforce temporary pool usage for some simple functions
@@ -3174,7 +3174,11 @@ sub gs_do_switch {
31743174
$self->{url} = $full_url;
31753175
$reparented = 1;
31763176
} else {
3177+
$_[0] = undef;
3178+
$self = undef;
3179+
$RA = undef;
31773180
$ra = Git::SVN::Ra->new($full_url);
3181+
$ra_invalid = 1;
31783182
}
31793183
}
31803184
$ra ||= $self;
@@ -3234,6 +3238,7 @@ sub gs_fetch_loop_common {
32343238
my $inc = $_log_window_size;
32353239
my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
32363240
my $longest_path = longest_common_path($gsv, $globs);
3241+
my $ra_url = $self->{url};
32373242
while (1) {
32383243
my %revs;
32393244
my $err;
@@ -3295,6 +3300,13 @@ sub gs_fetch_loop_common {
32953300
"$g->{t}-maxRev";
32963301
Git::SVN::tmp_config($k, $r);
32973302
}
3303+
if ($ra_invalid) {
3304+
$_[0] = undef;
3305+
$self = undef;
3306+
$RA = undef;
3307+
$self = Git::SVN::Ra->new($ra_url);
3308+
$ra_invalid = undef;
3309+
}
32983310
}
32993311
# pre-fill the .rev_db since it'll eventually get filled in
33003312
# with '0' x40 if something new gets committed

0 commit comments

Comments
 (0)