[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [bug?] perl bindings: SVN::Ra->new trips assertion when file:// URL contains a space

From: Jonathan Nieder <jrnieder_at_gmail.com>
Date: Sat, 17 Dec 2011 03:40:03 -0600

Bert Huijben wrote:

> I think SVN::Ra->new() should have escaped this argument for you by
> canonicalizing the argument before passing the value into the core library.

Makes sense. I tried the patch below and a variant that calls
svn_ra_open with a canonicalized url but leaves $self->{url} alone,
but neither seems to be close enough to the old semantics to get the
git-svn.perl test suite working well. The test suite ends up tripping
more assertions, like this one:

        svn: E235000: In file '/home/jrn/src/subversion/subversion/libsvn_wc/update_editor.c' line 1582: assertion failed (action == svn_wc_conflict_action_edit || action == svn_wc_conflict_action_delete || action == svn_wc_conflict_action_replace)
        Aborted (core dumped)

I'll experiment more. Thanks for explaining.

[[[
* subversion/bindings/swig/perl/native/Ra.pm
  (new): Canonicalize url parameter if it is not already canonical.
]]]
Index: subversion/bindings/swig/perl/native/Ra.pm
===================================================================
--- subversion/bindings/swig/perl/native/Ra.pm (revision 1215430)
+++ subversion/bindings/swig/perl/native/Ra.pm (working copy)
@@ -526,6 +526,7 @@ sub new {
     # instantiate callbacks
     $callback = (delete $self->{callback}) || $callback->new(auth => $self->{auth});
 
+ $self->{url} = SVN::_Core::svn_uri_canonicalize($self->{url});
     $self->{session} = SVN::_Ra::svn_ra_open($self->{url}, $callback, $self->{config} || {}, $pool);
     return $self;
 }
Received on 2011-12-17 10:40:50 CET

This is an archived mail posted to the Subversion Dev mailing list.