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

Cheng-Lung Sung clsung at tw.freebsd.org
Wed Apr 16 05:03:20 EDT 2008


Hi,
    It seems we need to patch SVN/Mirror/Ra.pm, but before that
    here is a similar workaround,

    Please use this patch and try again :) (also note the first
    patch segment was already provided before).

==================================================================
--- lib/SVK/Mirror.pm (revision 2736)
+++ lib/SVK/Mirror.pm (local)
@@ -118,6 +118,7 @@
     my $self = $class->SUPER::new($args);

     $self->{url} =~ s{/+$}{}g;
+    $self->{url} =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;

     $self->pool( SVN::Pool->new(undef) )
         unless $self->pool;
@@ -426,7 +427,11 @@
     my $target = $self->get_svkpath;

     my $lock_message = $self->_lock_message;
+    my $escaped_url = $self->url;
+    $escaped_url =~ s/([^0-9A-Za-z%\-\/:_.!~*'()])/sprintf("%%%02X", ord($1))/eg;
+
     my $svm = SVN::Mirror->new(
+        source => $escaped_url,
         target_path    => $self->path,
         repos          => $self->depot->repos,
         config         => SVK::Config->svnconfig,
==================================================================

Best Regards,
Cheng-Lung
On Wed, Apr 16, 2008 at 09:51:22AM +0200, Fabian Walk wrote:
> Hi,
> 
> I patched the SVNRa.pm and the complete synchronization with
> 
> $ svk mi http://svn.maul-theet.de/Bruel%20and%20Kjaer/ //mirror/BK
> or
> $ svk mi "http://svn.maul-theet.de/Bruel and Kjaer/" //mirror/BK
> 
> $ svk sync  //mirror/BK
> 
> works fine great work than you.
> 
> Only  when I try to sync a specific revision with the -s option than the 
>   error occurred again.
> 
> $ svk sync -s HEAD //mirror/BK
> svk is now taking a snapshot of the repository at:
>    http://svn.maul-theet.de/Bruel and Kjaer
> 
> This is essentially making a checkout of the url, and is bad if the
> url contains directories like trunk and branches.  If this isn't what
> you mean, please hit ^C.
> 
> Bad URL passed to RA layer: Malformed URL for repository
> 
> If it possible to solve that problem than I'm happy and can start to 
> work productively with svk.
> 
> Thanks,
> Fabian
> 
> Cheng-Lung Sung schrieb:
> > 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
> > ==================================================================
> _______________________________________________
> svk-users mailing list
> svk-users at lists.bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/svk-users

-- 
Alan Cheng-Lung Sung - clsung@


More information about the svk-users mailing list