[RFC] non_atomic_put(create_parent_dir)

John Arbash Meinel john at arbash-meinel.com
Fri Aug 18 21:38:45 BST 2006

This bundle updates non_atomic_put() so that it can be requested to try
creating the parent directory if it does not exist. Since that is going
to be a common use case for me with my next set of Knit changes.

I'd like comments on whether this seems reasonable at all. I added
appropriate tests, and made it work with the default implementation, as
well as Local and SFTP transports.

I think the SFTP implementation might actually need to be updated a
little, because I *think* it is possible that we won't get an actual
NoSuchFile exception until we start writing, which means we have read
the first hunk of the source file, so we need to buffer that first hunk
if we are going to retry the put(). However, I just tried it, and didn't
have any problems, so it could just be 'get()' that doesn't fail until
you read().

I'm not requesting this one be merged yet, but I wrote it, and I might
end up using it for my changes to Knits.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060818/3f0ad41a/attachment.pgp 

More information about the bazaar mailing list