makedirs() function for transports
Bug #120135 reported by
Jonathan Lange
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Wishlist
|
Unassigned | ||
Launchpad itself |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
It would be nice if bzrlib provided a makedirs() function that created a directory and all of its parent directories on a transport, ala os.makedirs().
I reckon add it as a module-level function in bzrlib.transport and make it something like 'makedirs(
The code to do this could be extracted out of the bowels of cmd_push.
tags: | added: tech-debt |
To post a comment you must log in.
This seems reasonable, though there is still one question.
Which is whether it should fail if the target directory already exists.
os.makedirs() will raise an exception if the target exists, while 'mkdir -p' will not.
Most of our current code just silently swallows the exception that is naturally raised by the mkdir() call, so I would tend to implement it that way. What did you have in mind?