b.r.InterRepository(InterObject) : class documentation

Part of bzrlib.repository View In Hierarchy

Known subclasses: bzrlib.tests.test_repository.InterDummy, bzrlib.vf_repository.InterVersionedFileRepository

This class represents operations taking place between two repositories.

Its instances have methods like copy_content and fetch, and contain references to the source and target repositories these operations can be carried out on.

Often we will provide convenience methods on 'repository' which carry out operations with another repository - they will always forward to InterRepository.get(other).method_name(parameters).

Method copy_content Make a complete copy of the content in self into destination.
Method fetch Fetch the content required to construct revision_id.
Method search_missing_revision_ids Return the revision ids that source has that target does not.
Static Method _same_model True if source and target have the same data representation.
Static Method _assert_same_model Raise an exception if two repositories do not use the same model.

Inherited from InterObject:

Method __init__ Construct a default InterObject instance. Please use 'get'.
Class Method get Retrieve a Inter worker object for these objects.
Method lock_read Take out a logical read lock.
Method lock_write Take out a logical write lock.
Class Method register_optimiser Register an InterObject optimiser.
Method unlock Release the locks on source and target.
Class Method unregister_optimiser Unregister an InterObject optimiser.
Method _double_lock Take out two locks, rolling back the first if the second throws.
@needs_write_lock
def copy_content(self, revision_id=None):
Make a complete copy of the content in self into destination.

This is a destructive operation! Do not use it on existing repositories.

Parametersrevision_idOnly copy the content needed to construct revision_id and its parents.
@needs_write_lock
def fetch(self, revision_id=None, find_ghosts=False, fetch_spec=None):
Fetch the content required to construct revision_id.

The content is copied from self.source to self.target.

Parametersrevision_idif None all content is copied, if NULL_REVISION no content is copied.
ReturnsNone.
@needs_read_lock
def search_missing_revision_ids(self, revision_id=symbol_versioning.DEPRECATED_PARAMETER, find_ghosts=True, revision_ids=None, if_present_ids=None, limit=None):
Return the revision ids that source has that target does not.
Parametersrevision_idonly return revision ids included by this revision_id.
revision_idsreturn revision ids included by these revision_ids. NoSuchRevision will be raised if any of these revisions are not present.
if_present_idslike revision_ids, but will not cause NoSuchRevision if any of these are absent, instead they will simply not be in the result. This is useful for e.g. finding revisions to fetch for tags, which may reference absent revisions.
find_ghostsIf True find missing revisions in deep history rather than just finding the surface difference.
limitMaximum number of revisions to return, topologically ordered
ReturnsA bzrlib.graph.SearchResult.
@staticmethod
def _same_model(source, target):
True if source and target have the same data representation.

Note: this is always called on the base class; overriding it in a subclass will have no effect.

@staticmethod
def _assert_same_model(source, target):
Raise an exception if two repositories do not use the same model.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.