You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Stephen Connolly <st...@gmail.com> on 2009/05/21 20:02:00 UTC

valid filenames

does svn support filenames containing /

ie on unix

fish\/clam.doc

Sent from my [rhymes with myPod] ;-)

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2352663

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: valid filenames

Posted by Stephen Connolly <st...@gmail.com>.
2009/5/22 Ryan Schmidt <su...@ryandesign.com>

> On May 21, 2009, at 17:12, Stephen Connolly wrote:
>
>  On May 21, 2009, at 15:45, Andrey Repin wrote:
>>
>>  On May 21, 2009, at 15:06, Tyler Roscoe wrote:
>>>
>>>  On May 21, 2009, at 15:02, Stephen Connolly wrote:
>>>>
>>>>  does svn support filenames containing /
>>>>>
>>>>> ie on unix
>>>>>
>>>>> fish\/clam.doc
>>>>>
>>>>
>>>> Since / is not allowed in filenames on any Unix I've ever used, my
>>>> answer would be "No, and if it does it's a terrible idea to use this
>>>> 'feature'."
>>>>
>>>
>>> Neither on Windows. (moreover, for dos/windows, forward and backward
>>> slashes
>>> are interchangeable)
>>>
>>
>> I don't want to create a filename with a slash in it. I want to ensure
>> that when encoding a path in an URL, I don't have to worry about
>> escaping slashes
>>
>
> I'm having a little trouble understanding your question. Maybe if you gave
> an example. But I think the answer is probably that things will "just work"
> as they should. Of course you can (and should) create a test repository and
> try everything out, and then email us with specific questions if you find
> something that doesn't work as you expected (showing us the commands you
> typed, what you got, and what you expected to get).
>
>
>
>
I am one of the developers of Hudson.  I wrote the integration for sventon.


For sventon 1.x they took the svn path as an url parameter, so you just used
URLEncoder.encode(path, "UTF-8") to pass the path.

For sventon 2.x they switched to making the svn path part of the path
portion of the URL, so if you use URLEncoder.encode(path, "UTF-8") to encode
the path... (which you need to at least partly do in case the svn path
includes spaces, etc) then that escapes the '/' characters...

So I have switched to

StringBuilder escaped = new StringBuilder();

if (path.startsWith("/")) {
  escaped.append("/");
}
boolean first = true;
for (String pathElement: path.split("/")) {
  if (first) {
    escaped.append("/");
    first = false;
  }
  escaped.append(URLEncoder.encode(pathElement), "UTF-8");
}

if (path.endsWith("/") {
  escaped.append("/");
}

return escaped;

So then I worried, what if svn is *crazy* and supports escaping '/' in a
path to support '/' in a pathname... in such a case you might see "\/" and
by splitting at the "/" characters I would break the escaping...

So I try to ask in a more clear way...

"Does Subversion support '/' characters in file names?"

I'm hoping the answer is "no" and I was just worrying for nothing.

-Stephen

P.S.  I know that the above code is possibly still a bit too aggresive
w.r.t. encoding strange characters and I may have to write my own URL
encoder anyway to get it "just right"... but I suspect sventon is
correspondingly over-agressive in URL decoding... just not aggressive enough
to handle an escaped "/" character

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2352803

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: valid filenames

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 21, 2009, at 17:12, Stephen Connolly wrote:

> On May 21, 2009, at 15:45, Andrey Repin wrote:
>
>> On May 21, 2009, at 15:06, Tyler Roscoe wrote:
>>
>>> On May 21, 2009, at 15:02, Stephen Connolly wrote:
>>>
>>>> does svn support filenames containing /
>>>>
>>>> ie on unix
>>>>
>>>> fish\/clam.doc
>>>
>>> Since / is not allowed in filenames on any Unix I've ever used, my
>>> answer would be "No, and if it does it's a terrible idea to use this
>>> 'feature'."
>>
>> Neither on Windows. (moreover, for dos/windows, forward and backward
>> slashes
>> are interchangeable)
>
> I don't want to create a filename with a slash in it. I want to ensure
> that when encoding a path in an URL, I don't have to worry about
> escaping slashes

I'm having a little trouble understanding your question. Maybe if you  
gave an example. But I think the answer is probably that things will  
"just work" as they should. Of course you can (and should) create a  
test repository and try everything out, and then email us with  
specific questions if you find something that doesn't work as you  
expected (showing us the commands you typed, what you got, and what  
you expected to get).

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2352722

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: valid filenames

Posted by Stephen Connolly <st...@gmail.com>.
I don't want to create a filename with a slash in it. I want to ensure  
that when encoding a path in an URL, I don't have to worry about  
escaping slashes


Sent from my [rhymes with myPod] ;-)

On 21 May 2009, at 21:45, Andrey Repin <an...@freemail.ru> wrote:

> Greetings, Tyler Roscoe!
>
>>> does svn support filenames containing /
>>>
>>> ie on unix
>>>
>>> fish\/clam.doc
>
>> Since / is not allowed in filenames on any Unix I've ever used, my
>> answer would be "No, and if it does it's a terrible idea to use this
>> 'feature'."
>
> Neither on Windows. (moreover, for dos/windows, forward and backward  
> slashes
> are interchangeable)
>
>
> --
> WBR,
> Andrey Repin (anrdaemon@freemail.ru) 22.05.2009, <0:41>
>
> Sorry for my terrible english...
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2352679
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org 
> ].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2352691

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: valid filenames

Posted by Andrey Repin <an...@freemail.ru>.
Greetings, Tyler Roscoe!

>> does svn support filenames containing /
>> 
>> ie on unix
>> 
>> fish\/clam.doc

> Since / is not allowed in filenames on any Unix I've ever used, my
> answer would be "No, and if it does it's a terrible idea to use this
> 'feature'."

Neither on Windows. (moreover, for dos/windows, forward and backward slashes
are interchangeable) 


--
WBR,
 Andrey Repin (anrdaemon@freemail.ru) 22.05.2009, <0:41>

Sorry for my terrible english...

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2352679

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: valid filenames

Posted by Tyler Roscoe <ty...@cryptio.net>.
On Thu, May 21, 2009 at 09:02:00PM +0100, Stephen Connolly wrote:
> does svn support filenames containing /
> 
> ie on unix
> 
> fish\/clam.doc

Since / is not allowed in filenames on any Unix I've ever used, my
answer would be "No, and if it does it's a terrible idea to use this
'feature'."

tyler