At http://bzr.arbash-meinel.com/branches/bzr/brisbane/knit_parent_hack
------------------------------------------------------------
revno: 3807
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: knit_parent_hack
timestamp: Tue 2008-12-02 20:35:42 -0600
message:
Hack the inventory serialization to use multiple lines.
=== modified file 'bzrlib/inventory.py'
--- a/bzrlib/inventory.py 2008-11-18 19:27:46 +0000
+++ b/bzrlib/inventory.py 2008-12-03 02:35:42 +0000
@@ -1348,18 +1348,18 @@
exec_str = "Y"
else:
exec_str = "N"
- return "file: %s\x00%s\x00%s\x00%s\x00%s\x00%d\x00%s" % (
+ return "file: %s\n%s\n%s\n%s\n%s\n%d\n%s" % (
entry.file_id, parent_str, name_str, entry.revision,
entry.text_sha1, entry.text_size, exec_str)
elif entry.kind == 'directory':
- return "dir: %s\x00%s\x00%s\x00%s" % (
+ return "dir: %s\n%s\n%s\n%s" % (
entry.file_id, parent_str, name_str, entry.revision)
elif entry.kind == 'symlink':
- return "symlink: %s\x00%s\x00%s\x00%s\x00%s" % (
+ return "symlink: %s\n%s\n%s\n%s\n%s" % (
entry.file_id, parent_str, name_str, entry.revision,
entry.symlink_target.encode("utf8"))
elif entry.kind == 'tree-reference':
- return "tree: %s\x00%s\x00%s\x00%s\x00%s" % (
+ return "tree: %s\n%s\n%s\n%s\n%s" % (
entry.file_id, parent_str, name_str, entry.revision,
entry.reference_revision)
else:
@@ -1367,7 +1367,7 @@
def _bytes_to_entry(self, bytes):
"""Deserialise a serialised entry."""
- sections = bytes.split('\x00')
+ sections = bytes.split('\n')
if sections[0].startswith("file: "):
result = InventoryFile(sections[0][6:],
sections[2].decode('utf8'),
--
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits