Rev 5019: WorkingTreeFormat2 don't support not normalized filenames. in file:///home/vila/src/bzr/bugs/322767-dont-add-conflict-related-files/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Feb 11 10:52:17 GMT 2010


At file:///home/vila/src/bzr/bugs/322767-dont-add-conflict-related-files/

------------------------------------------------------------
revno: 5019
revision-id: v.ladeuil+lp at free.fr-20100211105217-0tjbnl540lky4ywx
parent: v.ladeuil+lp at free.fr-20100210164109-q5wluu91am3vsf6d
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 322767-dont-add-conflict-related-files
timestamp: Thu 2010-02-11 11:52:17 +0100
message:
  WorkingTreeFormat2 don't support not normalized filenames.
  
  * bzrlib/tests/per_workingtree/test_smart_add.py:
  (TestSmartAddTreeUnicode.test_accessible_explicit,
  TestSmartAddTreeUnicode.test_accessible_implicit): Expected
  failures for WorkingTreeFormat2.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_workingtree/test_smart_add.py'
--- a/bzrlib/tests/per_workingtree/test_smart_add.py	2010-02-08 16:36:13 +0000
+++ b/bzrlib/tests/per_workingtree/test_smart_add.py	2010-02-11 10:52:17 +0000
@@ -269,7 +269,14 @@
 
     def test_accessible_explicit(self):
         osutils.normalized_filename = osutils._accessible_normalized_filename
-        self.wt.smart_add([u'a\u030a'])
+        if isinstance(self.workingtree_format, workingtree.WorkingTreeFormat2):
+            self.expectFailure(
+                'With WorkingTreeFormat2, smart_add requires'
+                ' normalized unicode filenames',
+                self.assertRaises, errors.NoSuchFile,
+                self.wt.smart_add, [u'a\u030a'])
+        else:
+            self.wt.smart_add([u'a\u030a'])
         self.wt.lock_read()
         self.addCleanup(self.wt.unlock)
         self.assertEqual([('', 'directory'), (u'\xe5', 'file')],
@@ -278,12 +285,19 @@
 
     def test_accessible_implicit(self):
         osutils.normalized_filename = osutils._accessible_normalized_filename
-        self.wt.smart_add([])
+        if isinstance(self.workingtree_format, workingtree.WorkingTreeFormat2):
+            self.expectFailure(
+                'With WorkingTreeFormat2, smart_add requires'
+                ' normalized unicode filenames',
+                self.assertRaises, errors.NoSuchFile,
+                self.wt.smart_add, [])
+        else:
+            self.wt.smart_add([])
         self.wt.lock_read()
         self.addCleanup(self.wt.unlock)
         self.assertEqual([('', 'directory'), (u'\xe5', 'file')],
-                         [(path, ie.kind) for path,ie in
-                          self.wt.inventory.iter_entries()])
+                         [(path, ie.kind) for path,ie
+                          in self.wt.inventory.iter_entries()])
 
     def test_inaccessible_explicit(self):
         osutils.normalized_filename = osutils._inaccessible_normalized_filename



More information about the bazaar-commits mailing list