b.r.p.NewPack(Pack) : class documentation

Part of bzrlib.repofmt.pack_repo View In Hierarchy

Known subclasses: bzrlib.repofmt.groupcompress_repo.GCPack

An in memory proxy for a pack which is being created.
Method __init__ Create a NewPack instance.
Method abort Cancel creating this pack.
Method access_tuple Return a tuple (transport, name) for the pack content.
Method data_inserted True if data has been added to this pack.
Method finish_content Undocumented
Method finish Finish the new pack.
Method flush Flush any current data.
Method set_write_cache_size Undocumented
Method _get_external_refs Undocumented
Method _write_index Write out an index.

Inherited from Pack:

Method file_name Get the file name for the pack on disk.
Method get_revision_count Undocumented
Method index_name Get the disk name of an index type for pack name 'name'.
Method index_offset Get the position in a index_size array for a given index type.
Method inventory_index_name The inv index is the name + .iix.
Method revision_index_name The revision index is the name + .rix.
Method signature_index_name The signature index is the name + .six.
Method text_index_name The text index is the name + .tix.
Method _check_references Make sure our external references are present.
Method _replace_index_with_readonly Undocumented
def __init__(self, pack_collection, upload_suffix='', file_mode=None):
Create a NewPack instance.
Parameterspack_collectionA PackCollection into which this is being inserted.
upload_suffixAn optional suffix to be given to any temporary files created during the pack creation. e.g '.autopack'
file_modeUnix permissions for newly created file.
def abort(self):
Cancel creating this pack.
def access_tuple(self):
Return a tuple (transport, name) for the pack content.
def data_inserted(self):
True if data has been added to this pack.
def finish_content(self):
Undocumented
def finish(self, suspend=False):

Finish the new pack.

This:
  • finalises the content
  • assigns a name (the md5 of the content, currently)
  • writes out the associated indices
  • renames the pack into place.
  • stores the index size tuple for the pack in the index_sizes attribute.
def flush(self):
Flush any current data.
def _get_external_refs(self, index):
Undocumented
def set_write_cache_size(self, size):
Undocumented
def _write_index(self, index_type, index, label, suspend=False):
Write out an index.
Parametersindex_typeThe type of index to write - e.g. 'revision'.
indexThe index object to serialise.
labelWhat label to give the index e.g. 'revision'.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.