[MERGE] Support FTP servers with non-atomic rename (bug #89436)

Aaron Bentley aaron.bentley at utoronto.ca
Mon Apr 16 21:53:20 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:

> FTPTransport.rename() should not be using 'fancy_rename'.
> FTPTransport.move() should.

Well:

$ cat -n bzrlib/transport/ftp.py
...
   447
   448      rename = move
   449

I'll separate these out.

> I guess I was mistaken in which functions you were changing. I would not
> use "fancy_rename" for directories, and I certainly would avoid it in
> 'def rename()'.

Why would you avoid using it for directories?  I think with my changes,
it's suitable for use with them.

> Transport.move() is defined to have POSIX file rename semantics. So it
> will overwrite an existing file.
> 
> 
> So your change should have been to FtpTransport.move()

Yeah, it was, but...

> Arguably they could be called:
> 
>  rename_with_overwrite()
> and
>  rename_no_replace()
> 
> Or something like that to make it more clear.

Yeah, I'd say "rename" and "rename_no_replace" is suitable, because
rename_with_overwrite has consistent behavior across platforms, and
should be the obvious choice.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGI+JA0F+nu1YWqI0RAiMuAJ0QAQ+Gs9toNy6K5wlhNT8tR5SeigCcDquN
YZJbAbN2aC/vjMXBSP+LbW8=
=LWrw
-----END PGP SIGNATURE-----



More information about the bazaar mailing list