]> Pileus Git - ~andy/git/commitdiff
Git::SVN{,::Ra}: canonicalize earlier
authorMichael G. Schwern <schwern@pobox.com>
Sat, 28 Jul 2012 09:38:32 +0000 (02:38 -0700)
committerEric Wong <normalperson@yhbt.net>
Thu, 2 Aug 2012 21:45:56 +0000 (21:45 +0000)
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>
perl/Git/SVN.pm
perl/Git/SVN/Ra.pm

index ff747821fb637c586ea0a67b5aff01f7be26b9e3..dacac7fb463c4d5fb9a835f798f6dac01042ef18 100644 (file)
@@ -27,6 +27,8 @@ use Git::SVN::Utils qw(
        fatal
        can_compress
        join_paths
+       canonicalize_path
+       canonicalize_url
 );
 
 my $can_use_yaml;
@@ -2304,7 +2306,7 @@ sub path {
 
        if (@_) {
                my $path = shift;
-               $self->{path} = $path;
+               $self->{path} = canonicalize_path($path);
                return;
        }
 
@@ -2316,7 +2318,7 @@ sub url {
 
        if (@_) {
                my $url = shift;
-               $self->{url} = $url;
+               $self->{url} = canonicalize_url($url);
                return;
        }
 
index 9234bf99e80796b0095ccdc5d1c32e1b3ef30367..77bceb913ab866b9552487879394b6adc84567b4 100644 (file)
@@ -3,6 +3,10 @@ use vars qw/@ISA $config_dir $_ignore_refs_regex $_log_window_size/;
 use strict;
 use warnings;
 use SVN::Client;
+use Git::SVN::Utils qw(
+       canonicalize_url
+);
+
 use SVN::Ra;
 BEGIN {
        @ISA = qw(SVN::Ra);
@@ -137,7 +141,7 @@ sub url {
 
        if (@_) {
                my $url = shift;
-               $self->{url} = $url;
+               $self->{url} = canonicalize_url($url);
                return;
        }