[MERGE] Rename on Windows is able to change filename case. (#77740)
Alexander Belchenko
bialix at ukr.net
Mon Nov 19 22:58:43 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley пишет:
> 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
I'd like to merge this patch before I'll continue my case-insensitive work.
OK?
Alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHQhUjzYr338mxwCURAhMXAJ4427NiUVkpEwyBvV8ZRUxYf1m3JQCePJ7t
dStyO0I7LK9jX6sY1YglwJE=
=V/6F
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mv.change.case.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20071120/7ba90fb0/attachment.diff
More information about the bazaar
mailing list