patch feedback - unicode in store names

Robert Collins robertc at robertcollins.net
Wed Dec 7 03:40:19 GMT 2005


I dont recall whose patch this was ...

@@ -585,17 +585,17 @@ class BzrBranch(Branch):
             return ws
 
         if self._branch_format == 4:
-            self.inventory_store = get_store('inventory-store')
-            self.text_store = get_store('text-store')
-            self.revision_store = get_store('revision-store')
+            self.inventory_store = get_store(u'inventory-store')
+            self.text_store = get_store(u'text-store')
+            self.revision_store = get_store(u'revision-store')



But I'd like to note that this does not *prevent* the bug recurring, it
only *solves the current one*.

A better patch would be:


        def get_store(name, compressed=True, prefixed=False):
            # FIXME: This approach of assuming stores are all entirely
compressed
            # or entirely uncompressed is tidy, but breaks upgrade from 
            # some existing branches where there's a mixture; we
probably 
            # still want the option to look for both.
+            name = unicode(name)
            relpath = self.control_files._rel_controlfilename(name)


This will ensure that all stores are accessed via unicode versions of
the name, and also happens to be a smaller diff ;).

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051207/3455111f/attachment.pgp 


More information about the bazaar mailing list