b.r.p.PackRepository(MetaDirVersionedFileRepository) : class documentation

Part of bzrlib.repofmt.pack_repo View In Hierarchy

Known subclasses: bzrlib.repofmt.groupcompress_repo.CHKInventoryRepository, bzrlib.repofmt.knitpack_repo.KnitPackRepository

Repository with knit objects stored inside pack containers.

The layering for a KnitPackRepository is:

Graph        |  HPSS    | Repository public layer |
===================================================
Tuple based apis below, string based, and key based apis above
---------------------------------------------------
VersionedFiles
  Provides .texts, .revisions etc
  This adapts the N-tuple keys to physical knit records which only have a
  single string identifier (for historical reasons), which in older formats
  was always the revision_id, and in the mapped code for packs is always
  the last element of key tuples.
---------------------------------------------------
GraphIndex
  A separate GraphIndex is used for each of the
  texts/inventories/revisions/signatures contained within each individual
  pack file. The GraphIndex layer works in N-tuples and is unaware of any
  semantic value.
===================================================
Method __init__ instantiate a Repository.
Method suspend_write_group Undocumented
Method get_transaction Undocumented
Method is_locked Undocumented
Method is_write_locked Return True if this object is write locked.
Method lock_write Lock the repository for writes.
Method lock_read Lock the repository for reads.
Method leave_lock_in_place Tell this repository not to release the physical lock when this
Method dont_leave_lock_in_place Tell this repository to release the physical lock when this
Method pack Compress the data within the repository.
Method reconcile Reconcile this repository.
Method unlock Undocumented
Method _all_revision_ids See Repository.all_revision_ids().
Method _abort_write_group Template method for per-repository write group cleanup.
Method _make_parents_provider Undocumented
Method _refresh_data Helper called from lock_* to ensure coherency with disk.
Method _start_write_group Template method for per-repository write group startup.
Method _commit_write_group Template method for per-repository write group cleanup.
Method _resume_write_group Undocumented
Method _reconcile_pack Undocumented

Inherited from MetaDirRepository (via MetaDirVersionedFileRepository):

Method is_shared Return True if this repository is flagged as a shared repository.
Method set_make_working_trees Set the policy flag for making working trees when creating branches.
Method make_working_trees Returns the policy for making working trees on new branches.

Inherited from Repository (via MetaDirVersionedFileRepository, MetaDirRepository):

Method abort_write_group Commit the contents accrued within the current write group.
Method add_fallback_repository Add a repository to use for looking up data not held locally.
Method all_revision_ids Returns a list of all the revision ids in the repository.
Method break_lock Break a lock if one is present from another instance.
Static Method create Construct the current default format repository in controldir.
Method user_transport Undocumented
Method control_transport Undocumented
Method __repr__ Undocumented
Method has_same_location Returns a boolean indicating if this repository is at the same
Method is_in_write_group Return True if there is an open write group.
Method get_physical_lock_status Undocumented
Method gather_stats Gather statistics from a revision id.
Method find_branches Find branches underneath this repository.
Method search_missing_revision_ids Return the revision ids that other has that this does not.
Static Method open Open the repository rooted at base.
Method copy_content_into Make a complete copy of the content in self into destination.
Method commit_write_group Commit the contents accrued within the current write group.
Method refresh_data Re-read any data needed to synchronise with disk.
Method resume_write_group Undocumented
Method fetch Fetch the content required to construct revision_id from source.
Method create_bundle Undocumented
Method get_commit_builder Obtain a CommitBuilder for this repository.
Method clone Clone this repository into controldir using the current format.
Method start_write_group Start a write group in the repository.
Method sprout Create a descendent repository for new development.
Method has_revision True if this repository has a copy of the revision.
Method has_revisions Probe to find out the presence of multiple revisions.
Method get_revision Return the Revision object for a named revision.
Method get_revision_reconcile 'reconcile' helper routine that allows access to a revision always.
Method get_revisions Get many revisions at once.
Method get_deltas_for_revisions Produce a generator of revision deltas.
Method get_revision_delta Return the delta for one revision.
Method store_revision_signature Undocumented
Method add_signature_text Store a signature text for a revision.
Method iter_files_bytes Iterate through file versions.
Method get_rev_id_for_revno Return the revision id of a revno, given a later (revno, revid)
Method iter_reverse_revision_history Iterate backwards through revision ids in the lefthand history
Method revision_tree Return Tree for a revision on this branch.
Method revision_trees Return Trees for revisions in this repository.
Method get_ancestry Return a list of revision-ids integrated by a revision.
Method get_parent_map See graph.StackedParentsProvider.get_parent_map
Method get_known_graph_ancestry Return the known graph for a set of revision ids and their ancestors.
Method get_file_graph Return the graph walker for files.
Method get_graph Return the graph walker for this repository format
Method revision_ids_to_search_result Convert a set of revision ids to a graph SearchResult.
Method sign_revision Undocumented
Method verify_revision Verify the signature on a revision.
Method has_signature_for_revision_id Query for a revision signature for revision_id in the repository.
Method get_signature_text Return the text for a signature.
Method check Check consistency of all history of given revision_ids.
Method supports_rich_root Undocumented
Method _check_fallback_repository Check that this repository can fallback to repository safely.
Method _has_same_fallbacks Returns true if the repositories have the same fallbacks.
Method _create_sprouting_repo Undocumented
Method _find_parent_ids_of_revisions Find all parent ids that are mentioned in the revision graph.
Method _get_parent_map_no_fallbacks Same as Repository.get_parent_map except doesn't query fallbacks.
Method _make_parents_provider_unstacked Undocumented
Method _check Undocumented
Method _warn_if_deprecated Undocumented
Method _check_ascii_revisionid Private helper for ascii-only repositories.

Inherited from _RelockDebugMixin (via MetaDirVersionedFileRepository, MetaDirRepository, Repository):

Method _note_lock Undocumented

Inherited from VersionedFileRepository (via MetaDirVersionedFileRepository):

Method add_fallback_repository Add a repository to use for looking up data not held locally.
Method add_inventory Add the inventory inv to the repository as revision_id.
Method add_inventory_by_delta Add a new inventory expressed as a delta against another revision.
Method add_revision Add rev to the revision store as revision_id.
Method gather_stats See Repository.gather_stats().
Method get_commit_builder Obtain a CommitBuilder for this repository.
Method get_missing_parent_inventories Return the keys of missing inventory parents for revisions added in
Method has_revisions Probe to find out the presence of multiple revisions.
Method get_revision_reconcile 'reconcile' helper routine that allows access to a revision always.
Method get_revisions Get many revisions at once.
Method add_signature_text Store a signature text for a revision.
Method find_text_key_references Find the text key references within the repository.
Method fileids_altered_by_revision_ids Find the file ids and versions affected by revisions.
Method iter_files_bytes Iterate through file versions.
Method item_keys_introduced_by Get an iterable listing the keys of all the data introduced by a set
Method get_inventory Get Inventory object by revision id.
Method iter_inventories Get many inventories by revision_ids.
Method get_serializer_format Undocumented
Method revision_tree Return Tree for a revision on this branch.
Method revision_trees Return Trees for revisions in this repository.
Method get_parent_map See graph.StackedParentsProvider.get_parent_map
Method get_known_graph_ancestry Return the known graph for a set of revision ids and their ancestors.
Method get_file_graph Return the graph walker for text revisions.
Method has_signature_for_revision_id Query for a revision signature for revision_id in the repository.
Method get_signature_text Return the text for a signature.
Method _add_inventory_checked Add inv to the repository after checking the inputs.
Method _inventory_add_lines Store lines in inv_vf and return the sha1 of the inventory.
Method _add_revision Undocumented
Method _check_inventories Check the inventories found from the revision scan.
Method _do_check_inventories Helper for _check_inventories.
Method _check_record Check a single text from this repository.
Method _check_text Check a single text.
Method _eliminate_revisions_not_present Check every revision id in revision_ids to see if we have it.
Method _get_revisions Core work logic to get many revisions without sanity checks.
Method _iter_revisions Iterate over revision objects.
Method _inventory_xml_lines_for_keys Get a line iterator of the sort needed for findind references.
Method _find_file_ids_from_xml_inventory_lines Helper routine for fileids_altered_by_revision_ids.
Method _find_parent_keys_of_revisions Similar to _find_parent_ids_of_revisions, but used with keys.
Method _generate_text_key_index Generate a new text key index for the repository.
Method _do_generate_text_key_index Helper for _generate_text_key_index to avoid deep nesting.
Method _find_file_keys_to_fetch Undocumented
Method _find_non_file_keys_to_fetch Undocumented
Method _iter_inventories single-document based inventory iteration.
Method _iter_inventory_xmls Undocumented
Method _deserialise_inventory Transform the xml into an inventory object.
Method _get_inventory_xml Get serialized inventory as a string.
Method _filtered_revision_trees Return Tree for a revision on this branch with only some files.
Method _get_versioned_file_checker Return an object suitable for checking versioned files.
Method _check Undocumented
Method _find_inconsistent_revision_parents Find revisions with different parent lists in the revision object
Method _check_for_inconsistent_revision_parents Undocumented
Method _get_sink Return a sink for streaming into this repository.
Method _get_source Return a source for streaming from this repository.

Inherited from Repository (via MetaDirVersionedFileRepository, VersionedFileRepository):

Method abort_write_group Commit the contents accrued within the current write group.
Method all_revision_ids Returns a list of all the revision ids in the repository.
Method break_lock Break a lock if one is present from another instance.
Static Method create Construct the current default format repository in controldir.
Method user_transport Undocumented
Method control_transport Undocumented
Method __repr__ Undocumented
Method has_same_location Returns a boolean indicating if this repository is at the same
Method is_in_write_group Return True if there is an open write group.
Method get_physical_lock_status Undocumented
Method find_branches Find branches underneath this repository.
Method search_missing_revision_ids Return the revision ids that other has that this does not.
Static Method open Open the repository rooted at base.
Method copy_content_into Make a complete copy of the content in self into destination.
Method commit_write_group Commit the contents accrued within the current write group.
Method refresh_data Re-read any data needed to synchronise with disk.
Method resume_write_group Undocumented
Method fetch Fetch the content required to construct revision_id from source.
Method create_bundle Undocumented
Method clone Clone this repository into controldir using the current format.
Method start_write_group Start a write group in the repository.
Method sprout Create a descendent repository for new development.
Method has_revision True if this repository has a copy of the revision.
Method get_revision Return the Revision object for a named revision.
Method get_deltas_for_revisions Produce a generator of revision deltas.
Method get_revision_delta Return the delta for one revision.
Method store_revision_signature Undocumented
Method get_rev_id_for_revno Return the revision id of a revno, given a later (revno, revid)
Method iter_reverse_revision_history Iterate backwards through revision ids in the lefthand history
Method is_shared Return True if this repository is flagged as a shared repository.
Method get_ancestry Return a list of revision-ids integrated by a revision.
Method get_graph Return the graph walker for this repository format
Method revision_ids_to_search_result Convert a set of revision ids to a graph SearchResult.
Method set_make_working_trees Set the policy flag for making working trees when creating branches.
Method make_working_trees Returns the policy for making working trees on new branches.
Method sign_revision Undocumented
Method verify_revision Verify the signature on a revision.
Method check Check consistency of all history of given revision_ids.
Method supports_rich_root Undocumented
Method _check_fallback_repository Check that this repository can fallback to repository safely.
Method _has_same_fallbacks Returns true if the repositories have the same fallbacks.
Method _create_sprouting_repo Undocumented
Method _find_parent_ids_of_revisions Find all parent ids that are mentioned in the revision graph.
Method _get_parent_map_no_fallbacks Same as Repository.get_parent_map except doesn't query fallbacks.
Method _make_parents_provider_unstacked Undocumented
Method _warn_if_deprecated Undocumented
Method _check_ascii_revisionid Private helper for ascii-only repositories.

Inherited from _RelockDebugMixin (via MetaDirVersionedFileRepository, VersionedFileRepository, Repository):

Method _note_lock Undocumented
def __init__(self, _format, a_bzrdir, control_files, _commit_builder_class, _serializer):
instantiate a Repository.
Parameters_formatThe format of the repository on disk.
controldirThe ControlDir of the repository.
control_filesControl files to use for locking, etc.
@needs_read_lock
def _all_revision_ids(self):
See Repository.all_revision_ids().
def _abort_write_group(self):
Template method for per-repository write group cleanup.

This is called during abort before the write group is considered to be finished and should cleanup any internal state accrued during the write group. There is no requirement that data handed to the repository be not made available - this is not a rollback - but neither should any attempt be made to ensure that data added is fully commited. Abort is invoked when an error has occured so futher disk or network operations may not be possible or may error and if possible should not be attempted.

def _make_parents_provider(self):
Undocumented
def _refresh_data(self):
Helper called from lock_* to ensure coherency with disk.

The default implementation does nothing; it is however possible for repositories to maintain loaded indices across multiple locks by checking inside their implementation of this method to see whether their indices are still valid. This depends of course on the disk format being validatable in this manner. This method is also called by the refresh_data() public interface to cause a refresh to occur while in a write lock so that data inserted by a smart server push operation is visible on the client's instance of the physical repository.

def _start_write_group(self):
Template method for per-repository write group startup.

This is called before the write group is considered to be entered.

def _commit_write_group(self):
Template method for per-repository write group cleanup.

This is called before the write group is considered to be finished and should ensure that all data handed to the repository for writing during the write group is safely committed (to the extent possible considering file system caching etc).

def suspend_write_group(self):
Undocumented
def _resume_write_group(self, tokens):
Undocumented
def get_transaction(self):
Undocumented
def is_locked(self):
Undocumented
def is_write_locked(self):
Return True if this object is write locked.
def lock_write(self, token=None):
Lock the repository for writes.
ReturnsA bzrlib.repository.RepositoryWriteLockResult.
def lock_read(self):
Lock the repository for reads.
ReturnsA bzrlib.lock.LogicalLockResult.
def leave_lock_in_place(self):
Tell this repository not to release the physical lock when this object is unlocked.

If lock_write doesn't return a token, then this method is not supported.

def dont_leave_lock_in_place(self):
Tell this repository to release the physical lock when this object is unlocked, even if it didn't originally acquire it.

If lock_write doesn't return a token, then this method is not supported.

@needs_write_lock
def pack(self, hint=None, clean_obsolete_packs=False):
Compress the data within the repository.

This will pack all the data to a single pack. In future it may recompress deltas or do other such expensive operations.

@needs_write_lock
def reconcile(self, other=None, thorough=False):
Reconcile this repository.
def _reconcile_pack(self, collection, packs, extension, revs, pb):
Undocumented
@only_raises(errors.LockNotHeld, errors.LockBroken)
def unlock(self):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.