MKCOL question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

MKCOL question

Paul Hammant-3
Hi gang,

(non subversion-client usage warning, also BDD ahead warning)

Given I have a directory /path/to/missing/directory/ that does not exist on the Svn server at all  
When I want to put a file in there (say foo.mp3)
Then I have to MKCOL path/
And I have to MKCOL path/to/
And I have to MKCOL path/to/missing
And I have to MKCOL path/to/missing/directory/
And only the can I then PUT path/to/missing/directory/foo.mp3


I'd love to be able to make the directories in a oner. Like Unix's mkdir -p option.

Or something better still in the PUT operation, if there were extra header params I was not aware of. 

- Paul
Reply | Threaded
Open this post in threaded view
|

Re: MKCOL question

Branko Čibej
On 09.10.2017 16:36, Paul Hammant wrote:

> Hi gang,
>
> /(non subversion-client usage warning, also BDD ahead warning)/
>
> Given I have a directory /path/to/missing/directory/ that does not
> exist on the Svn server at all  
> When I want to put a file in there (say foo.mp3)
> Then I have to MKCOL path/
> And I have to MKCOL path/to/
> And I have to MKCOL path/to/missing
> And I have to MKCOL path/to/missing/directory/
> And only the can I then PUT path/to/missing/directory/foo.mp3

That is a limitation of the MKCOL method, as described here:

https://tools.ietf.org/html/rfc4918#section-9.3


> I'd love to be able to make the directories in a oner. Like Unix's
> mkdir -p option.

It's more like Unix's mkdir(2) than mkdir(1).

> Or something better still in the PUT operation, if there were extra
> header params I was not aware of.

https://tools.ietf.org/html/rfc4918#section-9.7.1 ...

The best you can do, as far as I'm aware, without violating the WebDAV
spec, is to pipeline the MKCOL and PUT requests.

-- Brane
Reply | Threaded
Open this post in threaded view
|

Re: MKCOL question

Paul Hammant-3
Well pipelining into Svn's HTTP 1.1 interface does work as you suggested. 

There is a library in Python called 'hyper' that does it - http://hyper.readthedocs.io/en/latest/quickstart.html#streams though the example get_response signature is not current (I raised a bug).  Also, if I change HTTPConnection to HTTP11Connection it works, but not if I change to HTTP20Connection (ConnectionResetError) so I think I'll just leave my implementation as it is - mechanically recursing through MKCOL operations over a single reused connection.