Rev 2318: WorkingTree.merged_modified() needs to switch back to utf8 file ids. in http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/unicode_id_warnings

John Arbash Meinel john at arbash-meinel.com
Fri Mar 2 17:19:26 GMT 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/unicode_id_warnings

------------------------------------------------------------
revno: 2318
revision-id: john at arbash-meinel.com-20070302171917-e2x26bl23cetyxw1
parent: john at arbash-meinel.com-20070302171052-yn19ifc2f323tvqs
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: unicode_id_warnings
timestamp: Fri 2007-03-02 11:19:17 -0600
message:
  WorkingTree.merged_modified() needs to switch back to utf8 file ids.
  And AddCustomIDAction should also be generating utf8 ids.
modified:
  bzrlib/tests/test_smart_add.py test_smart_add.py-20050824235919-c60dcdb0c8e999ce
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
-------------- next part --------------
=== modified file 'bzrlib/tests/test_smart_add.py'
--- a/bzrlib/tests/test_smart_add.py	2006-09-10 19:04:48 +0000
+++ b/bzrlib/tests/test_smart_add.py	2007-03-02 17:19:17 +0000
@@ -154,9 +154,11 @@
     def __call__(self, inv, parent_ie, path, kind):
         # The first part just logs if appropriate
         # Now generate a custom id
-        file_id = kind + '-' + path.raw_path.replace('/', '%')
+        file_id = osutils.safe_file_id(kind + '-'
+                                       + path.raw_path.replace('/', '%'),
+                                       warn=False)
         if self.should_print:
-            self._to_file.write('added %s with id %s\n' 
+            self._to_file.write('added %s with id %s\n'
                                 % (path.raw_path, file_id))
         return file_id
 

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2007-02-26 04:40:16 +0000
+++ b/bzrlib/workingtree.py	2007-03-02 17:19:17 +0000
@@ -856,7 +856,8 @@
         except StopIteration:
             raise errors.MergeModifiedFormatError()
         for s in RioReader(hashfile):
-            file_id = s.get("file_id")
+            # RioReader reads in Unicode, so convert file_ids back to utf8
+            file_id = osutils.safe_file_id(s.get("file_id"), warn=False)
             if file_id not in self.inventory:
                 continue
             text_hash = s.get("hash")



More information about the bazaar-commits mailing list