class documentation

Object store that can overlay multiple object stores.

Method __init__ Initialize an OverlayObjectStore.
Method __iter__ Iterate over all object SHAs in the overlaid stores.
Method add_object Add a single object to the store.
Method add_objects Add multiple objects to the store.
Method contains_loose Check if an object is loose in any base store.
Method contains_packed Check if an object is packed in any base store.
Method get_raw Get the raw object data from the overlaid stores.
Method iter_unpacked_subset Iterate over unpacked objects from the overlaid stores.
Method iterobjects_subset Iterate over a subset of objects from the overlaid stores.
Instance Variable add_store Undocumented
Instance Variable bases Undocumented
Property packs Get the list of packs from all overlaid stores.

Inherited from BaseObjectStore:

Method __contains__ Check if a particular object is present by SHA1.
Method __getitem__ Obtain an object by SHA1.
Method close Close any files opened by this object store.
Method determine_wants_all Determine which objects are wanted based on refs.
Method find_common_revisions Find which revisions this store has in common using graphwalker.
Method find_missing_objects Find the missing objects required for a set of revisions.
Method generate_pack_data Generate pack data objects for a set of wants/haves.
Method get_commit_graph Get the commit graph for this object store.
Method get_object_mtime Get the modification time of an object.
Method get_reachability_provider Get a reachability provider for this object store.
Method iter_prefix Iterate over all SHA1s that start with a given prefix.
Method iter_tree_contents Iterate the contents of a tree and all subtrees.
Method peel_sha Peel all tags from a SHA.
Method prune Prune/clean up this object store.
Method tree_changes Find the differences between the contents of two trees.
Method write_commit_graph Write a commit graph file for this object store.
Instance Variable object_format Undocumented
Method _get_depth Return the current available depth for the given head.
def __init__(self, bases: list[BaseObjectStore], add_store: BaseObjectStore | None = None):

Initialize an OverlayObjectStore.

Parameters
bases:list[BaseObjectStore]List of base object stores to overlay
add_store:BaseObjectStore | NoneOptional store to write new objects to
Raises
ValueErrorIf stores have different hash algorithms
def __iter__(self) -> Iterator[ObjectID]:

Iterate over all object SHAs in the overlaid stores.

Returns
Iterator[ObjectID]Iterator of object SHAs (deduped across stores)
def add_object(self, object: ShaFile):

Add a single object to the store.

Parameters
object:ShaFileObject to add
Raises
NotImplementedErrorIf no add_store was provided
def add_objects(self, objects: Sequence[tuple[ShaFile, str | None]], progress: Callable[[str], None] | None = None) -> Pack | None:

Add multiple objects to the store.

Parameters
objects:Sequence[tuple[ShaFile, str | None]]Iterator of objects to add
progress:Callable[[str], None] | NoneOptional progress reporting callback
Returns
Pack | NoneUndocumented
Raises
NotImplementedErrorIf no add_store was provided
def contains_loose(self, sha: ObjectID | RawObjectID) -> bool:

Check if an object is loose in any base store.

Parameters
sha:ObjectID | RawObjectIDSHA of the object
Returns
boolTrue if object is loose in any base store
def contains_packed(self, sha: ObjectID | RawObjectID) -> bool:

Check if an object is packed in any base store.

Parameters
sha:ObjectID | RawObjectIDSHA of the object
Returns
boolTrue if object is packed in any base store
def get_raw(self, sha_id: ObjectID | RawObjectID) -> tuple[int, bytes]:

Get the raw object data from the overlaid stores.

Parameters
sha_id:ObjectID | RawObjectIDSHA of the object
Returns
tuple[int, bytes]Tuple of (type_num, raw_data)
Raises
KeyErrorIf object not found in any base store
def iter_unpacked_subset(self, shas: Iterable[ObjectID | RawObjectID], include_comp: bool = False, allow_missing: bool = False, convert_ofs_delta: bool = True) -> Iterator[UnpackedObject]:

Iterate over unpacked objects from the overlaid stores.

Parameters
shas:Iterable[ObjectID | RawObjectID]Iterable of object SHAs to retrieve
include_comp:boolWhether to include compressed data
allow_missing:boolIf True, skip missing objects; if False, raise KeyError
convert_ofs_delta:boolWhether to convert OFS_DELTA objects
Returns
Iterator[UnpackedObject]Iterator of unpacked objects
Raises
KeyErrorIf an object is missing and allow_missing is False
def iterobjects_subset(self, shas: Iterable[ObjectID], *, allow_missing: bool = False) -> Iterator[ShaFile]:

Iterate over a subset of objects from the overlaid stores.

Parameters
shas:Iterable[ObjectID]Iterable of object SHAs to retrieve
allow_missing:boolIf True, skip missing objects; if False, raise KeyError
Returns
Iterator[ShaFile]Iterator of ShaFile objects
Raises
KeyErrorIf an object is missing and allow_missing is False
add_store =

Undocumented

bases =

Undocumented

packs: list[Pack] =

Get the list of packs from all overlaid stores.

Returns
Combined list of packs from all base stores