At http://bzr.arbash-meinel.com/branches/bzr/brisbane/chk_map

------------------------------------------------------------
revno: 3798
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: chk_map
timestamp: Tue 2008-12-02 14:43:14 -0600
message:
  Turns out that the LeafNode split code needs to be aware of having a key
  that will fit in the '\x00' location.
=== modified file 'bzrlib/chk_map.py'
--- a/bzrlib/chk_map.py 2008-12-02 18:57:28 +0000
+++ b/bzrlib/chk_map.py 2008-12-02 20:43:14 +0000
@@ -509,6 +509,13 @@
             for key, value in self._items.iteritems():
                 serialised_key = self._serialised_key(key)
                 prefix = serialised_key[:split_at]
+                # TODO: Generally only 1 key can be exactly the right length,
+                #       which means we can only have 1 key in the node pointed
+                #       at by the 'prefix\0' key. We might want to consider
+                #       folding it into the containing InternalNode rather than
+                #       having a fixed length-1 node.
+                if len(prefix) < split_at:
+                    prefix += '\x00'*(split_at - len(prefix))
                 if prefix not in result:
                     node = LeafNode()
                     node.set_maximum_size(self._maximum_size)

-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to