@@ -876,10 +876,6 @@ sub cmd_multi_init {
876
876
usage(1);
877
877
}
878
878
879
- # there are currently some bugs that prevent multi-init/multi-fetch
880
- # setups from working well without this.
881
- $Git::SVN::_minimize_url = 1;
882
-
883
879
$_prefix = ' ' unless defined $_prefix;
884
880
if (defined $url ) {
885
881
$url = canonicalize_url($url );
@@ -1180,7 +1176,7 @@ sub complete_url_ls_init {
1180
1176
" wanted to set to: $gs ->{url}\n " ;
1181
1177
}
1182
1178
command_oneline(' config' , $k , $gs -> {url }) unless $orig_url ;
1183
- my $remote_path = " $ra ->{svn_path }/$repo_path " ;
1179
+ my $remote_path = " $gs ->{path }/$repo_path " ;
1184
1180
$remote_path =~ s # /+# /# g ;
1185
1181
$remote_path =~ s # ^/## g ;
1186
1182
$remote_path .= " /*" if $remote_path !~ / \* / ;
@@ -2177,16 +2173,6 @@ sub ra {
2177
2173
$ra ;
2178
2174
}
2179
2175
2180
- sub rel_path {
2181
- my ($self ) = @_ ;
2182
- my $repos_root = $self -> ra-> {repos_root };
2183
- return $self -> {path } if ($self -> {url } eq $repos_root );
2184
- my $url = $self -> {url } .
2185
- (length $self -> {path } ? " /$self ->{path}" : $self -> {path });
2186
- $url =~ s ! ^\Q $repos_root\E (?:/+|$)!! g ;
2187
- $url ;
2188
- }
2189
-
2190
2176
# prop_walk(PATH, REV, SUB)
2191
2177
# -------------------------
2192
2178
# Recursively traverse PATH at revision REV and invoke SUB for each
@@ -2512,10 +2498,7 @@ sub match_paths {
2512
2498
if (my $path = $paths -> {" /$self ->{path}" }) {
2513
2499
return ($path -> {action } eq ' D' ) ? 0 : 1;
2514
2500
}
2515
- my $repos_root = $self -> ra-> {repos_root };
2516
- my $extended_path = $self -> {url } . ' /' . $self -> {path };
2517
- $extended_path =~ s # ^\Q $repos_root\E (/|$)## ;
2518
- $self -> {path_regex } ||= qr / ^\/\Q $extended_path \E\/ / ;
2501
+ $self -> {path_regex } ||= qr / ^\/\Q $self ->{path}\E\/ / ;
2519
2502
if (grep /$self -> {path_regex }/, keys %$paths ) {
2520
2503
return 1;
2521
2504
}
@@ -2545,7 +2528,7 @@ sub find_parent_branch {
2545
2528
return undef unless defined $paths ;
2546
2529
2547
2530
# look for a parent from another branch:
2548
- my @b_path_components = split m # /# , $self -> rel_path ;
2531
+ my @b_path_components = split m # /# , $self -> { path } ;
2549
2532
my @a_path_components ;
2550
2533
my $i ;
2551
2534
while (@b_path_components ) {
@@ -2563,11 +2546,11 @@ sub find_parent_branch {
2563
2546
my $r = $i -> {copyfrom_rev };
2564
2547
my $repos_root = $self -> ra-> {repos_root };
2565
2548
my $url = $self -> ra-> {url };
2566
- my $new_url = $repos_root . $branch_from ;
2549
+ my $new_url = $url . $branch_from ;
2567
2550
print STDERR " Found possible branch point: " ,
2568
2551
" $new_url => " , $self -> full_url, " , $r \n " ;
2569
2552
$branch_from =~ s # ^/## ;
2570
- my $gs = $self -> other_gs($new_url , $url , $repos_root ,
2553
+ my $gs = $self -> other_gs($new_url , $url ,
2571
2554
$branch_from , $r , $self -> {ref_id });
2572
2555
my ($r0 , $parent ) = $gs -> find_rev_before($r , 1);
2573
2556
{
@@ -2752,9 +2735,9 @@ sub parse_svn_date {
2752
2735
}
2753
2736
2754
2737
sub other_gs {
2755
- my ($self , $new_url , $url , $repos_root ,
2738
+ my ($self , $new_url , $url ,
2756
2739
$branch_from , $r , $old_ref_id ) = @_ ;
2757
- my $gs = Git::SVN-> find_by_url($new_url , $repos_root , $branch_from );
2740
+ my $gs = Git::SVN-> find_by_url($new_url , $url , $branch_from );
2758
2741
unless ($gs ) {
2759
2742
my $ref_id = $old_ref_id ;
2760
2743
$ref_id =~ s /\@\d +$// ;
@@ -4436,14 +4419,22 @@ sub get_log {
4436
4419
# externally passed pool (instead of our temporary and quickly cleared
4437
4420
# pool in Git::SVN::Ra) does not help matters at all...
4438
4421
my $receiver = pop @args ;
4422
+ my $prefix = " /" .$self -> {svn_path };
4423
+ $prefix =~ s # /+($)## ;
4424
+ my $prefix_regex = qr # ^\Q $prefix \E # ;
4439
4425
push (@args , sub {
4440
4426
my ($paths ) = $_ [0];
4441
4427
return &$receiver (@_ ) unless $paths ;
4442
4428
$_ [0] = ();
4443
4429
foreach my $p (keys %$paths ) {
4444
4430
my $i = $paths -> {$p };
4445
- my %s = map { $_ => $i -> $_ }
4446
- qw/ copyfrom_path copyfrom_rev action/ ;
4431
+ # Make path relative to our url, not repos_root
4432
+ $p =~ s / $prefix_regex// ;
4433
+ my %s = map { $_ => $i -> $_ ; }
4434
+ qw/ copyfrom_path copyfrom_rev action/ ;
4435
+ if ($s {' copyfrom_path' }) {
4436
+ $s {' copyfrom_path' } =~ s / $prefix_regex// ;
4437
+ }
4447
4438
$_ [0]{$p } = \%s ;
4448
4439
}
4449
4440
&$receiver (@_ );
0 commit comments