[svk-users] SVK mirror sync problem - quoted spaces in url

Cheng-Lung Sung clsung at tw.freebsd.org
Tue Apr 15 22:06:16 EDT 2008


Hi, 
    Please also apply this patch and try again :)

=== lib/SVK/Mirror/Backend/SVNRa.pm
==================================================================
--- lib/SVK/Mirror/Backend/SVNRa.pm     (revision 2736)
+++ lib/SVK/Mirror/Backend/SVNRa.pm     (local)
@@ -324,6 +324,7 @@
     if ( $self->_cached_ra ) {
         my $ra = delete $self->{_cached_ra};
         my $url = $args{url} || $self->mirror->url;
+        $url =~ s/([^0-9A-Za-z%\-\/:_.!~*'()])/sprintf("%%%02X", ord($1))/eg;
         return $ra if $ra->{url} eq $url;
         if ( _p_svn_ra_session_t->can('reparent') ) {
             $ra->reparent($url);
@@ -332,8 +333,10 @@
         }
     }
     $self->_initialize_svn;
+    my $escaped_url = $self->mirror->url;
+    $escaped_url =~ s/([^0-9A-Za-z%\-\/:_.!~*'()])/sprintf("%%%02X", ord($1))/eg;
     return SVN::Ra->new(
-        url    => $self->mirror->url,
+        url    => $escaped_url,
         auth   => $self->_auth_baton,
         config => $self->_config,
         %args
==================================================================

Thanks,
On Tue, Apr 15, 2008 at 12:07:26PM +0200, Fabian Walk wrote:
> Hi,
> 
> Cheng-Lung Sung schrieb:
> > Hi,
> >     Can you apply this patch and try again?
> 
> I have apply the patch and run the following test cases.
> 
> It seems that in case 3 and 4 the spaces in the url and the %20 that is 
> converted via the patch to spaces cause problems in the SVNRa module 
> when I use http instead of file as protocol.
> 
> 
> test case 1 (file url double quotes):
> =====================================
> $ svk mi "file:///D:/User/Fabian/SCM/svn-testrep/Bruel and Kjaer" 
> //mirror/BK
> Mirror initialized.  Run svk sync //mirror/BK to start mirroring.
> 
> $ svk sync //mirror/BK
> Syncing file:///D:/User/Fabian/SCM/svn-testrep/Bruel and Kjaer
> Retrieving log information from 1 to 1
> Committed revision 4 from revision 1.
> 
> 
> test case 2 (file url quotes):
> ==============================
> $ svk mi file:///D:/User/Fabian/SCM/svn-testrep/Bruel%20and%20Kjaer/ 
> //mirror/BK
> Mirror initialized.  Run svk sync //mirror/BK to start mirroring.
> 
> $ svk sync //mirror/BK
> Syncing file:///D:/User/Fabian/SCM/svn-testrep/Bruel and Kjaer
> Retrieving log information from 1 to 1
> Committed revision 4 from revision 1.
> 
> 
> test case 3 (http url double quotes):
> =====================================
> $ svk mi "http://svn.maul-theet.de/Bruel and Kjaer/" //mirror/BK
> Bad URL passed to RA layer: Malformed URL for repository
> 
> 
> test case 4 (http url quotes):
> ==============================
> $ svk mi http://svn.maul-theet.de/Bruel%20and%20Kjaer/ //mirror/BK
> Bad URL passed to RA layer: Malformed URL for repository

-- 
Alan Cheng-Lung Sung - clsung@


More information about the svk-users mailing list