[MERGE] Rename on Windows is able to change filename case. (#77740)
Aaron Bentley
aaron.bentley at utoronto.ca
Tue Nov 13 18:05:11 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alexander Belchenko wrote:
> No, it's actually needed, otherwise I get error from the else branch below:
>
> raise errors.RenameFailedFilesExist(from_rel, to_rel,
> extra="(Use --after to update the Bazaar id)")
Fair enough, keep it.
I guess this is another pitfall of look-before-you-leap; your conditions
may grow more and more convoluted, to try and match the exact error
condition you want to avoid. I don't think there's much we can do in
this case, though.
+ except (IOError, OSError), e:
+ # source and target may be aliases of each other (e.g. on a
+ # case-insensitive filesystem), so we may have accidentally
renamed
+ # source by when we tried to rename target
+ if (not file_existed
+ or e.errno not in (None, errno.ENOENT)
+ or old.lower() != new.lower()):
^^^ sorry I didn't notice this on the last review, but I'd like to
remove that lower() test. That makes it a more general solution for
aliasing detection, and means that we don't have to worry about
discrepancies in the way different platforms apply lowercasing.
bb:tweak
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHOedX0F+nu1YWqI0RAoD+AJ9QphE3MtZaYS2zTW8NeU9oWcPJKQCfarfZ
5zDc+EGRK89Oosw6wMTLBn8=
=qsjX
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list