Rev 46: Implement new handling of get_bytes_as(), and get_missing_compression_parent_keys() in http://bazaar.launchpad.net/%7Ebzr/bzr-groupcompress/trunk
John Arbash Meinel
john at arbash-meinel.com
Wed Feb 25 22:21:40 GMT 2009
At http://bazaar.launchpad.net/%7Ebzr/bzr-groupcompress/trunk
------------------------------------------------------------
revno: 46
revision-id: john at arbash-meinel.com-20090225222123-frjzu1meidd6qafi
parent: john at arbash-meinel.com-20090225221102-z0qgfbrfwwe2yscf
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: trunk
timestamp: Wed 2009-02-25 16:21:23 -0600
message:
Implement new handling of get_bytes_as(), and get_missing_compression_parent_keys()
Now works on bzr.dev's new streaming code.
-------------- next part --------------
=== modified file 'groupcompress.py'
--- a/groupcompress.py 2009-02-20 03:52:05 +0000
+++ b/groupcompress.py 2009-02-25 22:21:23 +0000
@@ -554,6 +554,16 @@
# recipe, and we often want to end up with lines anyway.
return plain, split_lines(plain[index_memo[3]:index_memo[4]])
+ def get_missing_compression_parent_keys(self):
+ """Return the keys of missing compression parents.
+
+ Missing compression parents occur when a record stream was missing
+ basis texts, or a index was scanned that had missing basis texts.
+ """
+ # GroupCompress cannot currently reference texts that are not in the
+ # group, so this is valid for now
+ return frozenset()
+
def get_record_stream(self, keys, ordering, include_delta_closure):
"""Get a stream of records for keys.
@@ -688,9 +698,9 @@
# Raise an error when a record is missing.
if record.storage_kind == 'absent':
raise errors.RevisionNotPresent([record.key], self)
- elif record.storage_kind in ('chunked', 'fulltext'):
+ try:
lines = osutils.chunks_to_lines(record.get_bytes_as('chunked'))
- else:
+ except errors.UnavailableRepresentation:
adapter_key = record.storage_kind, 'fulltext'
adapter = get_adapter(adapter_key)
bytes = adapter.get_bytes(record,
More information about the bazaar-commits
mailing list