You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Zk W <mp...@gmail.com> on 2015/07/07 19:58:33 UTC

how to svn merge of filename with spaces ?

Hi All

We have SVN 1.6.
We like to perform a svn merge on a file where its filename has spaces.
eg
Roaming Apple.txt

Is this syntax correct below to svn merge to a working copy ?
If not, what should it be ?

svn merge -c 12345 "https://mytext.abb.com/app/path/to/Roaming Apple.txt" .

using quotes?


Right now, we get error
svn: Unable to parse URL '/svn/app/!svn/bc/12576/path/to/Roaming Apple.txt
using
svn merge -c 12345 https://mytext.abb.com/app/path/to/Roaming Apple.txt .

Any help is appreciated.
Thank you

Re: how to svn merge of filename with spaces ?

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Wed, Jul 8, 2015 at 6:06 AM, Philip Martin
<ph...@wandisco.com> wrote:
> Branko Čibej <br...@wandisco.com> writes:
>
>> On 07.07.2015 19:58, Zk W wrote:
>>> Hi All
>>>
>>> We have SVN 1.6.
>>> We like to perform a svn merge on a file where its filename has spaces.
>>> eg
>>> Roaming Apple.txt
>>>
>>> Is this syntax correct below to svn merge to a working copy ?
>>> If not, what should it be ?
>>>
>>> svn merge -c 12345 "https://mytext.abb.com/app/path/to/Roaming
>>> Apple.txt" .
>>>
>>> using quotes?
>>>
>>>
>>> Right now, we get error
>>> svn: Unable to parse URL '/svn/app/!svn/bc/12576/path/to/Roaming Apple.txt
>>> using
>>> svn merge -c 12345 https://mytext.abb.com/app/path/to/Roaming Apple.txt .
>>>
>>> Any help is appreciated.
>>
>>
>> You have to properly escape spaces (and other special characters) in an
>> URL. See, for example,
>>
>>     https://en.wikipedia.org/wiki/Percent-encoding
>>
>> In your case, the URL would be
>>
>>     https://mytext.abb.com/app/path/to/Roaming%20Apple.txt
>
> It might be a bit more complicated than that.
>
> The command line client has code to auto-escape command line URLs.
> svn_client_args_to_target_array() calls svn_opt__arg_canonicalize_url.
> The client should automatically convert spaces to %20.
>
> The error message shows an ra_neon (or ra_serf?) error while failing to
> parse a bc URL from the server.  I think that means the client has
> correctly escaped the space and that the error is occurring later.  I
> suppose manually escaping the space might be sufficient to make it work,
> but it is possible that it will not and that a client/server upgrade is
> required.

This is also why sane pre-commit blocks often block the use of
whitespace, punctuation, and non-flat-text-ASCII characters in any
file or directory names. It won't save you at this moment, but it can
help prevent repititions of the problem in future projects. Files with
names like "Nico's Big Project(1883)[see notes]Look How Cool!!!!.html"
tend to choke the phlegm out of any scripting language that has to
deal with them. And note that I didn't even *try* for Unicode....

Re: how to svn merge of filename with spaces ?

Posted by Philip Martin <ph...@wandisco.com>.
Branko Čibej <br...@wandisco.com> writes:

> On 07.07.2015 19:58, Zk W wrote:
>> Hi All
>>
>> We have SVN 1.6.
>> We like to perform a svn merge on a file where its filename has spaces.
>> eg 
>> Roaming Apple.txt
>>
>> Is this syntax correct below to svn merge to a working copy ? 
>> If not, what should it be ?
>>
>> svn merge -c 12345 "https://mytext.abb.com/app/path/to/Roaming
>> Apple.txt" .
>>
>> using quotes?
>>
>>
>> Right now, we get error
>> svn: Unable to parse URL '/svn/app/!svn/bc/12576/path/to/Roaming Apple.txt
>> using
>> svn merge -c 12345 https://mytext.abb.com/app/path/to/Roaming Apple.txt .
>>
>> Any help is appreciated.
>
>
> You have to properly escape spaces (and other special characters) in an
> URL. See, for example,
>
>     https://en.wikipedia.org/wiki/Percent-encoding
>
> In your case, the URL would be
>
>     https://mytext.abb.com/app/path/to/Roaming%20Apple.txt

It might be a bit more complicated than that.

The command line client has code to auto-escape command line URLs.
svn_client_args_to_target_array() calls svn_opt__arg_canonicalize_url.
The client should automatically convert spaces to %20.

The error message shows an ra_neon (or ra_serf?) error while failing to
parse a bc URL from the server.  I think that means the client has
correctly escaped the space and that the error is occurring later.  I
suppose manually escaping the space might be sufficient to make it work,
but it is possible that it will not and that a client/server upgrade is
required.

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*

Re: Fwd: how to svn merge of filename with spaces ?

Posted by Robert Heller <he...@deepsoft.com>.
At Tue, 7 Jul 2015 11:23:25 -0700 Zk W <mp...@gmail.com> wrote:

> 
> 
> Hi Brane
> 
> Thanks for responding.
> 
> How about svn merging between working paths if the paths have spaces ?
> eg
> 
> svn merge -c 12345 src/path to/Roaming Apple.txt /src/another path/Roaming
> Apple.txt

For local files (working paths), you just have to follow the shell's quoting 
and escaping rules, eg:

svn merge -c 12345 src/path\ to/Roaming\ Apple.txt "/src/another path/Roaming Apple.txt"

man bash
man tcsh
man zsh
man ksh

etc.


> 
> 
> Thanks once again.
> 
> 
> 
> On Tue, Jul 7, 2015 at 11:14 AM, Branko Čibej <br...@wandisco.com> wrote:
> 
> > On 07.07.2015 19:58, Zk W wrote:
> > > Hi All
> > >
> > > We have SVN 1.6.
> > > We like to perform a svn merge on a file where its filename has spaces.
> > > eg
> > > Roaming Apple.txt
> > >
> > > Is this syntax correct below to svn merge to a working copy ?
> > > If not, what should it be ?
> > >
> > > svn merge -c 12345 "https://mytext.abb.com/app/path/to/Roaming
> > > Apple.txt" .
> > >
> > > using quotes?
> > >
> > >
> > > Right now, we get error
> > > svn: Unable to parse URL '/svn/app/!svn/bc/12576/path/to/Roaming
> > Apple.txt
> > > using
> > > svn merge -c 12345 https://mytext.abb.com/app/path/to/Roaming Apple.txt
> > .
> > >
> > > Any help is appreciated.
> >
> >
> > You have to properly escape spaces (and other special characters) in an
> > URL. See, for example,
> >
> >     https://en.wikipedia.org/wiki/Percent-encoding
> >
> > In your case, the URL would be
> >
> >     https://mytext.abb.com/app/path/to/Roaming%20Apple.txt
> >
> > -- Brane
> >
> 
>                                                                               

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller@deepsoft.com       -- Webhosting Services

Fwd: how to svn merge of filename with spaces ?

Posted by Zk W <mp...@gmail.com>.
Hi Brane

Thanks for responding.

How about svn merging between working paths if the paths have spaces ?
eg

svn merge -c 12345 src/path to/Roaming Apple.txt /src/another path/Roaming
Apple.txt


Thanks once again.



On Tue, Jul 7, 2015 at 11:14 AM, Branko Čibej <br...@wandisco.com> wrote:

> On 07.07.2015 19:58, Zk W wrote:
> > Hi All
> >
> > We have SVN 1.6.
> > We like to perform a svn merge on a file where its filename has spaces.
> > eg
> > Roaming Apple.txt
> >
> > Is this syntax correct below to svn merge to a working copy ?
> > If not, what should it be ?
> >
> > svn merge -c 12345 "https://mytext.abb.com/app/path/to/Roaming
> > Apple.txt" .
> >
> > using quotes?
> >
> >
> > Right now, we get error
> > svn: Unable to parse URL '/svn/app/!svn/bc/12576/path/to/Roaming
> Apple.txt
> > using
> > svn merge -c 12345 https://mytext.abb.com/app/path/to/Roaming Apple.txt
> .
> >
> > Any help is appreciated.
>
>
> You have to properly escape spaces (and other special characters) in an
> URL. See, for example,
>
>     https://en.wikipedia.org/wiki/Percent-encoding
>
> In your case, the URL would be
>
>     https://mytext.abb.com/app/path/to/Roaming%20Apple.txt
>
> -- Brane
>

Re: how to svn merge of filename with spaces ?

Posted by Branko Čibej <br...@wandisco.com>.
On 07.07.2015 19:58, Zk W wrote:
> Hi All
>
> We have SVN 1.6.
> We like to perform a svn merge on a file where its filename has spaces.
> eg 
> Roaming Apple.txt
>
> Is this syntax correct below to svn merge to a working copy ? 
> If not, what should it be ?
>
> svn merge -c 12345 "https://mytext.abb.com/app/path/to/Roaming
> Apple.txt" .
>
> using quotes?
>
>
> Right now, we get error
> svn: Unable to parse URL '/svn/app/!svn/bc/12576/path/to/Roaming Apple.txt
> using
> svn merge -c 12345 https://mytext.abb.com/app/path/to/Roaming Apple.txt .
>
> Any help is appreciated.


You have to properly escape spaces (and other special characters) in an
URL. See, for example,

    https://en.wikipedia.org/wiki/Percent-encoding

In your case, the URL would be

    https://mytext.abb.com/app/path/to/Roaming%20Apple.txt

-- Brane

Re: how to svn merge of filename with spaces ?

Posted by Robert Heller <he...@deepsoft.com>.
At Tue, 7 Jul 2015 10:58:33 -0700 Zk W <mp...@gmail.com> wrote:

> 
> 
> Hi All
> 
> We have SVN 1.6.
> We like to perform a svn merge on a file where its filename has spaces.
> eg
> Roaming Apple.txt
> 
> Is this syntax correct below to svn merge to a working copy ?
> If not, what should it be ?
> 
> svn merge -c 12345 "https://mytext.abb.com/app/path/to/Roaming Apple.txt" .
> 
> using quotes?
> 
> 
> Right now, we get error
> svn: Unable to parse URL '/svn/app/!svn/bc/12576/path/to/Roaming Apple.txt
> using
> svn merge -c 12345 https://mytext.abb.com/app/path/to/Roaming Apple.txt .
> 
> Any help is appreciated.
> Thank you

*URLs* cannot (legally) have spaces (the syntax spec forbids it). OTOH, it is
possible to use URL encoding to encode a local part with 'spaces' (hostnames 
never have spaces) into a URL:

svn merge -c 12345 https://mytext.abb.com/app/path/to/Roaming+Apple.txt .

OR

svn merge -c 12345 https://mytext.abb.com/app/path/to/Roaming%20Apple.txt .

OTOH, if you were refering to a plain local file, you could use single or 
double quotes:

svn log 'Roaming Apple.txt'

OR

svn log "Roaming Apple.txt"





> 
>                               

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller@deepsoft.com       -- Webhosting Services