[RFC] bug #111758: Bazaar does not indicate which file already exists with Error 17

Alexander Belchenko bialix at ukr.net
Sun Dec 2 00:27:46 GMT 2007


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

Aaron Bentley пишет:
> Alexander Belchenko wrote:
>> Aaron Bentley ?8H5B:
>>> Alexander Belchenko wrote:
>>>> Probably you can help me with my question re bug #111758.
>>>> I'm starting to write the test for this bug and eventually stumble
>>>> with my question.
>>>> === modified file 'bzrlib/tests/test_transform.py'
>>>> --- bzrlib/tests/test_transform.py 23.11.2007 10:31:24
>>>> +++ bzrlib/tests/test_transform.py 26.11.2007 16:49:07
>>>> @@ -983,8 +983,21 @@
>>>>          self.callDeprecated([txt], change_entry, None, None, None,
>>>> None, None,
>>>>              None, None, None)
>>>> +    def test_case_insensitive_clash(self):
>>>> +        def tt_helper():
>>>> +            wt = self.make_branch_and_tree('.')
>>>> +            tt = TreeTransform(wt)  # TreeTransform obtains write lock
>>>> +            try:
>>>> +                tt.new_file('foo', tt.root, 'bar')
>>>> +                tt.new_file('Foo', tt.root, 'spam')
>>>> +                tt.apply()
>>> This is a test for what happens when TT tries to create two files that
>>> are case-insensitively the same.  As I read it, bug 111758 is about
>>> errno 17, not case-insensitivity.  
>> You read bug title, but bug description said exactly about case-insensitivity:
> 
>> "This occured when checking out the same file twice during checkout on case-insensitive filesystems
>> (Windows in this case)."
> 
>> I believe your recent fix makes this bug report less valid. But bug still open and I want
>> to use test case above.
> 
> I still maintain that there were two separate problems:
> 1. poor handling of case-insensitivity
> 2. poor diagnostics when TreeTransform fails to detect conflicts.
> 
> This is a fix for 2., but the test is for 1, even though I outlined how
> to test 2.  So I'll abstain.

Do you mean following test?

=== modified file 'bzrlib/tests/test_transform.py'
- --- bzrlib/tests/test_transform.py	2007-12-01 21:59:46 +0000
+++ bzrlib/tests/test_transform.py	2007-12-02 00:25:37 +0000
@@ -1104,6 +1104,20 @@
         self.assertContainsRe(str(err),
             "^File exists: .+/foo")

+    def test_two_directories_clash(self):
+        def tt_helper():
+            wt = self.make_branch_and_tree('.')
+            tt = TreeTransform(wt)  # TreeTransform obtains write lock
+            try:
+                tt.new_directory('foo', tt.root)
+                tt.new_directory('foo', tt.root)
+                tt.apply(no_conflicts=True)
+            finally:
+                wt.unlock()
+        err = self.assertRaises(errors.FileExists, tt_helper)
+        self.assertContainsRe(str(err),
+            "^File exists: .+/foo")
+

 class TransformGroup(object):


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHUfwCzYr338mxwCURAuVhAJ99MpkbpYqsIeFzP70H4tNwv4cddgCeKCDG
3h0L6xkYiQz5tflxb7Ew5f4=
=2NFk
-----END PGP SIGNATURE-----



More information about the bazaar mailing list