Git::SVN{,::Ra}: canonicalize earlier

This canonicalizes paths and urls as early as possible so we don't have to remember to do it at the point of use. It will fix a swath of SVN 1.7 problems in one go. Its ok to double canonicalize things. SVN 1.7 still fails, still not worrying about that. [ew: commit title] Signed-off-by: Eric Wong <normalperson@yhbt.net>

Michael G. Schwern committed Jul 28, 2012 at 02:38 UTC 565e56c2cc7ebe42ad12ee5970f3d5af1dc3f36c
2 files changed +9 -3
perl/Git/SVN.pm
+4 -2
@@ -27,6 +27,8 @@ use Git::SVN::Utils qw(
27 fatal
28 can_compress
29 join_paths
30 + canonicalize_path
31 + canonicalize_url
32 );
33
34 my $can_use_yaml;
@@ -2304,7 +2306,7 @@ sub path {
2306
2307 if (@_) {
2308 my $path = shift;
2307 - $self->{path} = $path;
2309 + $self->{path} = canonicalize_path($path);
2310 return;
2311 }
2312
@@ -2316,7 +2318,7 @@ sub url {
2318
2319 if (@_) {
2320 my $url = shift;
2319 - $self->{url} = $url;
2321 + $self->{url} = canonicalize_url($url);
2322 return;
2323 }
2324
perl/Git/SVN/Ra.pm
+5 -1
@@ -3,6 +3,10 @@ use vars qw/@ISA $config_dir $_ignore_refs_regex $_log_window_size/;
3 use strict;
4 use warnings;
5 use SVN::Client;
6 +use Git::SVN::Utils qw(
7 + canonicalize_url
8 +);
9 +
10 use SVN::Ra;
11 BEGIN {
12 @ISA = qw(SVN::Ra);
@@ -137,7 +141,7 @@ sub url {
141
142 if (@_) {
143 my $url = shift;
140 - $self->{url} = $url;
144 + $self->{url} = canonicalize_url($url);
145 return;
146 }
147