You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Küng <to...@gmail.com> on 2008/09/25 17:00:36 UTC

relative externals fail with spaces

Hi,

A user reported a problem with relative externals on the TSVN mailing list:
http://tortoisesvn.tigris.org/servlets/ReadMsg?list=users&msgNo=14004

Attached is a test repository which shows this problem. I've verified
that the problem still exists in the Subversion trunk r33254, but only
for http/https served repositories. The problem does not exist for
file:/// or svn:// served repositories.

To reproduce the problem, check out /trunk from the attached repository,
which gives the error:

Error: URL 'https://192.168.2.5/svn/extrepo/trunk/folder with
space/libs/library1' is
Error: malformed or the scheme or host or path is missing


Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net

Re: relative externals fail with spaces

Posted by Stefan Küng <to...@gmail.com>.
Karl Fogel wrote:
> Stefan Küng <to...@gmail.com> writes:
>> I'm wondering: this change is in libsvn_client, i.e., it's independent
>> of the ra layer. But the issue only shows for http(s), not for file or
>> svn. So what are ra_svn and ra_local doing differently?
>> I'm not familiar with that part of the svn code, but couldn't this lead
>> to double-escaping of urls if ra_svn/ra_local already do this themselves?
> 
> What's going on is that file:// and svn:// do looser URL-parsing than
> http://.  The error came from libsvn_ra_neon/session.c:parse_url(); in
> fact, it's possible that with ra_serf, there would have been no error or
> a different error.  So file:// and svn:// weren't already doing the
> escaping themselves.  The difference is just that they could handle a
> URL with spaces in it :-).
> 
> (My patch passed 'make check' over all RA layers, and I checked svn://
> in GDB too -- the URL is not double-escaped there.)

Thanks for explaining!

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net


Re: relative externals fail with spaces

Posted by Karl Fogel <kf...@red-bean.com>.
Stefan Küng <to...@gmail.com> writes:
> I'm wondering: this change is in libsvn_client, i.e., it's independent
> of the ra layer. But the issue only shows for http(s), not for file or
> svn. So what are ra_svn and ra_local doing differently?
> I'm not familiar with that part of the svn code, but couldn't this lead
> to double-escaping of urls if ra_svn/ra_local already do this themselves?

What's going on is that file:// and svn:// do looser URL-parsing than
http://.  The error came from libsvn_ra_neon/session.c:parse_url(); in
fact, it's possible that with ra_serf, there would have been no error or
a different error.  So file:// and svn:// weren't already doing the
escaping themselves.  The difference is just that they could handle a
URL with spaces in it :-).

(My patch passed 'make check' over all RA layers, and I checked svn://
in GDB too -- the URL is not double-escaped there.)

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: relative externals fail with spaces

Posted by Stefan Küng <to...@gmail.com>.
Karl Fogel wrote:
> Stefan Küng <to...@gmail.com> writes:
>> Hi,
>>
>> A user reported a problem with relative externals on the TSVN mailing list:
>> http://tortoisesvn.tigris.org/servlets/ReadMsg?list=users&msgNo=14004
>>
>> Attached is a test repository which shows this problem. I've verified
>> that the problem still exists in the Subversion trunk r33254, but only
>> for http/https served repositories. The problem does not exist for
>> file:/// or svn:// served repositories.
>>
>> To reproduce the problem, check out /trunk from the attached repository,
>> which gives the error:
>>
>> Error: URL 'https://192.168.2.5/svn/extrepo/trunk/folder with
>> space/libs/library1' is
>> Error: malformed or the scheme or host or path is missing
> 
> Reproduced.  I think I've got the fix (see diff below); testing now.
> 
> -Karl
> 
> Index: subversion/libsvn_client/externals.c
> ===================================================================
> --- subversion/libsvn_client/externals.c	(revision 33358)
> +++ subversion/libsvn_client/externals.c	(working copy)
> @@ -1146,9 +1146,9 @@
>    len = strlen(cb->to_path);
>    if (ib.parent_dir[len] == '/')
>      ++len;
> -  ib.parent_dir_url = svn_path_join(cb->from_url,
> -                                    ib.parent_dir + len,
> -                                    cb->pool);
> +  ib.parent_dir_url = svn_path_url_add_component(cb->from_url,
> +                                                 ib.parent_dir + len,
> +                                                 cb->pool);

I'm wondering: this change is in libsvn_client, i.e., it's independent
of the ra layer. But the issue only shows for http(s), not for file or
svn. So what are ra_svn and ra_local doing differently?
I'm not familiar with that part of the svn code, but couldn't this lead
to double-escaping of urls if ra_svn/ra_local already do this themselves?

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net


Re: relative externals fail with spaces

Posted by Karl Fogel <kf...@red-bean.com>.
Stefan Küng <to...@gmail.com> writes:
> Hi,
>
> A user reported a problem with relative externals on the TSVN mailing list:
> http://tortoisesvn.tigris.org/servlets/ReadMsg?list=users&msgNo=14004
>
> Attached is a test repository which shows this problem. I've verified
> that the problem still exists in the Subversion trunk r33254, but only
> for http/https served repositories. The problem does not exist for
> file:/// or svn:// served repositories.
>
> To reproduce the problem, check out /trunk from the attached repository,
> which gives the error:
>
> Error: URL 'https://192.168.2.5/svn/extrepo/trunk/folder with
> space/libs/library1' is
> Error: malformed or the scheme or host or path is missing

Reproduced.  I think I've got the fix (see diff below); testing now.

-Karl

Index: subversion/libsvn_client/externals.c
===================================================================
--- subversion/libsvn_client/externals.c	(revision 33358)
+++ subversion/libsvn_client/externals.c	(working copy)
@@ -1146,9 +1146,9 @@
   len = strlen(cb->to_path);
   if (ib.parent_dir[len] == '/')
     ++len;
-  ib.parent_dir_url = svn_path_join(cb->from_url,
-                                    ib.parent_dir + len,
-                                    cb->pool);
+  ib.parent_dir_url = svn_path_url_add_component(cb->from_url,
+                                                 ib.parent_dir + len,
+                                                 cb->pool);
 
   /* We must use a custom version of svn_hash_diff so that the diff
      entries are processed in the order they were originally specified

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: relative externals fail with spaces

Posted by Karl Fogel <kf...@red-bean.com>.
Okay, fixed in r33369.  Thanks for the reproduction recipe, Stefan!

-Karl

Stefan Küng <to...@gmail.com> writes:
> A user reported a problem with relative externals on the TSVN mailing list:
> http://tortoisesvn.tigris.org/servlets/ReadMsg?list=users&msgNo=14004
>
> Attached is a test repository which shows this problem. I've verified
> that the problem still exists in the Subversion trunk r33254, but only
> for http/https served repositories. The problem does not exist for
> file:/// or svn:// served repositories.
>
> To reproduce the problem, check out /trunk from the attached repository,
> which gives the error:
>
> Error: URL 'https://192.168.2.5/svn/extrepo/trunk/folder with
> space/libs/library1' is
> Error: malformed or the scheme or host or path is missing

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org