[patch] add Transport.rename
Robert Collins
robertc at robertcollins.net
Tue Feb 21 02:01:11 GMT 2006
On Tue, 2006-02-21 at 12:57 +1100, Martin Pool wrote:
> On Tue, 2006-02-14 at 09:08 -0600, John A Meinel wrote:
> Here's a patch which adds a new Transport.rename() method, which is
> required to fail if the destination is an existing nonempty directory.
> This should be possible to atomically detect on all transports. (I
> don't think we can avoid overwriting existing files on on transports or
> filesystems without a race.) It also adds tests that all existing
> transports actually do this.
+1
> This leaves Transport.move() with the existing meaning, which is to try
> to overwrite an existing target using fancy_rename. Keeping this there
> seemed like the least intrusive change.
>
> > I *don't* think we want to make fancy_rename a higher level than
> > transport. Because then all the clients would need to know if they are
> > using a Transport (or platform) which doesn't support atomic rename, and
> > then they need to activate the fancy rename.
>
> I think it's better to make it a utility which can be used by transport
> implementation that need it to meet the right contract for move().
> Perhaps it should be a protected Transport method.
+1 for this direction.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060221/1ecf44f7/attachment.pgp
More information about the bazaar
mailing list