[MERGE] Rename on Windows is able to change filename case. (#77740)
Alexander Belchenko
bialix at ukr.net
Mon Nov 19 19:00:36 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley пишет:
> Alexander Belchenko wrote:
>> I'm thinking more about different cases, and eventually implement base
>> logic to detect case-insensitive filesystem in WorkingTree4 constructor.
>> Right now it's only used for mv, but step-by-step we (me) could improve
>> all another parts of bzr to implement spec about CIFS support.
>
> bb:comment
>
> I like the idea. I think CIFS is a confusing abbreviation, because it
> can also refer to Common Internet File System:
> http://www.webopedia.com/TERM/C/CIFS.htm
>
> Especially if you consider that Linux clients may access
> case-insensitive filesystems over Common Internet File System.
Yep. You're right. Good abbreviation is too hard to find.
>
>> + # we can't use failUnlessExists on case-insensitive filesystem
>> + # so try to check shape of the tree
>
> What happens if we do failUnlessExists?
failUnlessExists for case-insensitive filesystem never fail for test
that change case.
But that comment actually incorrect. Probably you tries to say me so.
We can't use failIfExists on case-insensitive filesystem, actually.
I'll change it.
>> + def test_filesystem_case_detection(self):
>> + # check actual state of filesystem
>> + self.build_tree(['a', 'b/'])
>> + is_A = osutils.isfile('A')
>> + is_B = osutils.isdir('B')
>> + self.assertEquals(is_A, is_B)
>> + real_cifs = is_A
>
> ^^ perhaps change this variable name to "really_case_sensitive" (and
> invert the meaning).
I have no objections here.
> Also, instead of making this a workingtree4 test, I think it should be a
> workingtree_implementations test, because we'll want future formats to
> support this.
In this case I need to implement case-sensitive detection for all existing
wt formats. It's not hard, I just think it's redundant. But if I don't do
it, workingtree_implementation testing will be harder. OK, will do for
all formats.
>> === modified file 'bzrlib/workingtree.py'
>> --- bzrlib/workingtree.py 2007-11-13 18:39:31 +0000
>> +++ bzrlib/workingtree.py 2007-11-14 15:01:42 +0000
>> @@ -270,6 +270,8 @@
>> # the Format factory and creation methods that are
>> # permitted to do this.
>> self._set_inventory(_inventory, dirty=False)
>> + # dummy case-insensitive fs flag
>> + self.cifs = False
>
> ^^^ perhaps change this variable name to "case_sensitive" and invert the
> meaning?
ok.
>> + elif (self.cifs and has_from_rel
>> + and from_rel.lower() == to_rel.lower()):
>> only_change_inv = False
>
> Perhaps it would be cleaner to introduce WorkingTree.is_same_file() or
> something? I just think that every use of the .cifs var is likely to be
> testing whether two files are the same.
I'm not sure here, maybe you're right.
Thank you for review. I'll update my patch shortly.
Alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHQd1UzYr338mxwCURAlSyAJ4qpd1GnLnurBPoMzv1+0D1oibY2wCfaVNZ
u2yhDE6Z7c5nOjOXAn8Ryv0=
=CTay
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list