b.b.s.v.BundleWriter(object) : class documentation

Part of bzrlib.bundle.serializer.v4 View In Hierarchy

Writer for bundle-format files.

This serves roughly the same purpose as ContainerReader, but acts as a layer on top of it.

Provides ways of writing the specific record types supported this bundle format.

Method __init__ Undocumented
Method begin Start writing the bundle
Method end Finish writing the bundle
Method add_multiparent_record Add a record for a multi-parent diff
Method add_fulltext_record Add a record for a fulltext
Method add_info_record Add an info record to the bundle
Static Method encode_name Encode semantic ids as a container name
Method _write_encoded Write bzip2-encoded bytes to the file
Method _add_record Add a bundle record to the container.
def __init__(self, fileobj):
Undocumented
def _write_encoded(self, bytes):
Write bzip2-encoded bytes to the file
def begin(self):
Start writing the bundle
def end(self):
Finish writing the bundle
def add_multiparent_record(self, mp_bytes, sha1, parents, repo_kind, revision_id, file_id):
Add a record for a multi-parent diff
Unknown Field: mp_bytesA multi-parent diff, as a bytestring
Unknown Field: sha1The sha1 hash of the fulltext
Unknown Field: parentsa list of revision-ids of the parents
Unknown Field: repo_kindThe kind of object in the repository. May be 'file' or 'inventory'
Unknown Field: revision_idThe revision id of the mpdiff being added.
Unknown Field: file_idThe file-id of the file, or None for inventories.
def add_fulltext_record(self, bytes, parents, repo_kind, revision_id):
Add a record for a fulltext
Unknown Field: bytesThe fulltext, as a bytestring
Unknown Field: parentsa list of revision-ids of the parents
Unknown Field: repo_kindThe kind of object in the repository. May be 'revision' or 'signature'
Unknown Field: revision_idThe revision id of the fulltext being added.
def add_info_record(self, **kwargs):
Add an info record to the bundle

Any parameters may be supplied, except 'self' and 'storage_kind'. Values must be lists, strings, integers, dicts, or a combination.

@staticmethod
def encode_name(content_kind, revision_id, file_id=None):
Encode semantic ids as a container name
def _add_record(self, bytes, metadata, repo_kind, revision_id, file_id):
Add a bundle record to the container.

Most bundle records are recorded as header/body pairs, with the body being nameless. Records with storage_kind 'header' have no body.

API Documentation for Bazaar, generated by pydoctor at 2019-10-23 00:34:42.