use Git::SVN{,::RA}->url accessor globally

Note: The structure returned from Git::SVN->read_all_remotes() does not appear to contain objects, so I'm leaving them alone. That's everything converted over to the url and path accessors. No functional change. [ew: commit title] Signed-off-by: Eric Wong <normalperson@yhbt.net>

Michael G. Schwern committed Jul 27, 2012 at 13:00 UTC b1ea6c3829109aff412095b889432bf496f46a90
3 files changed +15 -13
git-svn.perl
+6 -5
@@ -1395,7 +1395,7 @@ sub cmd_commit_diff {
1395 fatal("Needed URL or usable git-svn --id in ",
1396 "the command-line\n", $usage);
1397 }
1398 - $url = $gs->{url};
1398 + $url = $gs->url;
1399 $svn_path = $gs->path;
1400 }
1401 unless (defined $_revision) {
@@ -1663,15 +1663,16 @@ sub complete_url_ls_init {
1663 "and a separate URL is not specified");
1664 }
1665 }
1666 - my $url = $ra->{url};
1666 + my $url = $ra->url;
1667 my $gs = Git::SVN->init($url, undef, undef, undef, 1);
1668 my $k = "svn-remote.$gs->{repo_id}.url";
1669 my $orig_url = eval { command_oneline(qw/config --get/, $k) };
1670 - if ($orig_url && ($orig_url ne $gs->{url})) {
1670 + if ($orig_url && ($orig_url ne $gs->url)) {
1671 die "$k already set: $orig_url\n",
1672 - "wanted to set to: $gs->{url}\n";
1672 + "wanted to set to: $gs->url\n";
1673 }
1674 - command_oneline('config', $k, $gs->{url}) unless $orig_url;
1674 + command_oneline('config', $k, $gs->url) unless $orig_url;
1675 +
1676 my $remote_path = $gs->path . "/$repo_path";
1677 $remote_path =~ s{%([0-9A-F]{2})}{chr hex($1)}ieg;
1678 $remote_path =~ s#/+#/#g;
perl/Git/SVN.pm
+6 -5
@@ -560,7 +560,7 @@ sub _set_svm_vars {
560 # username is of no interest
561 $src =~ s{(^[a-z\+]*://)[^/@]*@}{$1};
562
563 - my $replace = $ra->{url};
563 + my $replace = $ra->url;
564 $replace .= "/$path" if length $path;
565
566 my $section = "svn-remote.$self->{repo_id}";
@@ -599,16 +599,17 @@ sub _set_svm_vars {
599 $path = $ra->{svn_path};
600 $ra = Git::SVN::Ra->new($ra->{repos_root});
601 while (length $path) {
602 - unless ($tried{"$ra->{url}/$path"}) {
602 + my $try = $ra->url ."/$path";
603 + unless ($tried{$try}) {
604 $ok = $self->read_svm_props($ra, $path, $r);
605 last if $ok;
605 - $tried{"$ra->{url}/$path"} = 1;
606 + $tried{$try} = 1;
607 }
608 $path =~ s#/?[^/]+$##;
609 }
610 die "Path: '$path' should be ''\n" if $path ne '';
611 $ok ||= $self->read_svm_props($ra, $path, $r);
611 - $tried{"$ra->{url}/$path"} = 1;
612 + $tried{$ra->url ."/$path"} = 1;
613 if (!$ok) {
614 die @err, (map { " $_\n" } keys %tried), "\n";
615 }
@@ -1108,7 +1109,7 @@ sub find_parent_branch {
1109 }
1110 my $r = $i->{copyfrom_rev};
1111 my $repos_root = $self->ra->{repos_root};
1111 - my $url = $self->ra->{url};
1112 + my $url = $self->ra->url;
1113 my $new_url = $url . $branch_from;
1114 print STDERR "Found possible branch point: ",
1115 "$new_url => ", $self->full_url, ", $r\n"
perl/Git/SVN/Migration.pm
+3 -3
@@ -177,14 +177,14 @@ sub minimize_connections {
177 my $ra = Git::SVN::Ra->new($url);
178
179 # skip existing cases where we already connect to the root
180 - if (($ra->{url} eq $ra->{repos_root}) ||
180 + if (($ra->url eq $ra->{repos_root}) ||
181 ($ra->{repos_root} eq $repo_id)) {
182 - $root_repos->{$ra->{url}} = $repo_id;
182 + $root_repos->{$ra->url} = $repo_id;
183 next;
184 }
185
186 my $root_ra = Git::SVN::Ra->new($ra->{repos_root});
187 - my $root_path = $ra->{url};
187 + my $root_path = $ra->url;
188 $root_path =~ s#^\Q$ra->{repos_root}\E(/|$)##;
189 foreach my $path (keys %$fetch) {
190 my $ref_id = $fetch->{$path};