[MERGE] Fix case-sensitivity detection

Alexander Belchenko bialix at ukr.net
Wed Nov 28 19:53:58 GMT 2007


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

Aaron Bentley пишет:
> Aaron Bentley has voted resubmit.
> Status is now: Resubmit
> Comment:
> I'll fix this up, and resubmit it tomorrow, unless someone wants to
> investigate it first.

I found it.
Actually problem is in small typo. Should be:

    def test_case_sensitive(self):
        """If filesystem is case-sensitive, tree should report this.

        We check case-sensitivity by creating a file with a lowercase name,
        then testing whether it exists with an uppercase name.
        """
        self.build_tree(['filename'])

self.build_tree takes the list of names to build.
Your code is

        self.build_tree('filename')

and because string supports
`for i in 'filename'`
iteration you don't have any error.
IMO we should fix build_tree method as well.
I suggest to add assert that argument is actually
list or tuple to avoid such confusions in the future.

But fixing this place in turn reveals real problem in your test:

======================================================================
FAIL: test_case_sensitive (bzrlib.tests.workingtree_implementations.test_workingtree.TestWorkingTree)

vvvv[log from
bzrlib.tests.workingtree_implementations.test_workingtree.TestWorkingTree.test_case_sensitive(WorkingTreeFormat2)]
created control directory in file:///C:/tmp/testbzr-auz6tp.tmp/tmprtkhqn/work/test/
creating repository in file:///C:/tmp/testbzr-auz6tp.tmp/tmprtkhqn/work/test/.bzr/.
creating branch <bzrlib.branch.BzrBranchFormat4 object at 0x012508F0> in
file:///C:/tmp/testbzr-auz6tp.tmp/tmprtkhqn
/work/test/.bzr/
opening working tree 'C:/tmp/testbzr-auz6tp.tmp/tmprtkhqn/work/test'
failed to open C:/tmp/testbzr-auz6tp.tmp/tmprtkhqn/work/test/.bzr/stat-cache: [Errno 2] No such file
or directory: u'C:/tmp/testbzr-auz6tp.tmp/tmprtkhqn/work/test/.bzr/stat-cache'
write hc
opening working tree 'C:/tmp/testbzr-auz6tp.tmp/tmprtkhqn/work/test'
opening working tree 'C:/tmp/testbzr-auz6tp.tmp'

^^^^[log from
bzrlib.tests.workingtree_implementations.test_workingtree.TestWorkingTree.test_case_sensitive(WorkingTreeFormat2)]
- ----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\work\Bazaar\mydev\aaron\bzrlib\tests\workingtree_implementations\test_workingtree.py",
line 865, in test_
case_sensitive
    self.assertEqual(case_sensitive, tree.case_sensitive)
AssertionError: not equal:
a = False
b = True


- ----------------------------------------------------------------------
Ran 3 tests in 0.609s

FAILED (failures=1)
tests failed


This is failed because WorkingTree2 does not use .bzr/checkout directory for working tree, IIRC.
You should either change case sensitiveness detection in wt2 or skip this test for wt2.
I prefer latter option. Because wt2 is not supported AFAIK.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTcdWzYr338mxwCURAonAAJ9ircCECoF+70gzQU8wPaY7Iv6+4gCfdUCy
/0DoW8csM/klTnf7b+CaU/g=
=Y7Nn
-----END PGP SIGNATURE-----



More information about the bazaar mailing list