class documentation
class OverlayObjectStore(BaseObjectStore):
Constructor: OverlayObjectStore(bases, add_store)
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 |
Add a single object to the store. |
| Method | add |
Add multiple objects to the store. |
| Method | contains |
Check if an object is loose in any base store. |
| Method | contains |
Check if an object is packed in any base store. |
| Method | get |
Get the raw object data from the overlaid stores. |
| Method | iter |
Iterate over unpacked objects from the overlaid stores. |
| Method | iterobjects |
Iterate over a subset of objects from the overlaid stores. |
| Instance Variable | add |
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 |
Determine which objects are wanted based on refs. |
| Method | find |
Find which revisions this store has in common using graphwalker. |
| Method | find |
Find the missing objects required for a set of revisions. |
| Method | generate |
Generate pack data objects for a set of wants/haves. |
| Method | get |
Get the commit graph for this object store. |
| Method | get |
Get the modification time of an object. |
| Method | get |
Get a reachability provider for this object store. |
| Method | iter |
Iterate over all SHA1s that start with a given prefix. |
| Method | iter |
Iterate the contents of a tree and all subtrees. |
| Method | peel |
Peel all tags from a SHA. |
| Method | prune |
Prune/clean up this object store. |
| Method | tree |
Find the differences between the contents of two trees. |
| Method | write |
Write a commit graph file for this object store. |
| Instance Variable | object |
Undocumented |
| Method | _get |
Return the current available depth for the given head. |
Initialize an OverlayObjectStore.
| Parameters | |
bases:list[ | List of base object stores to overlay |
addBaseObjectStore | None | Optional store to write new objects to |
| Raises | |
ValueError | If stores have different hash algorithms |
Add a single object to the store.
| Parameters | |
object:ShaFile | Object to add |
| Raises | |
NotImplementedError | If no add_store was provided |
def add_objects(self, objects:
Sequence[ tuple[ ShaFile, str | None]], progress: Callable[ [ str], None] | None = None) -> Pack | None:
¶
Check if an object is loose in any base store.
| Parameters | |
sha:ObjectID | RawObjectID | SHA of the object |
| Returns | |
bool | True if object is loose in any base store |
Check if an object is packed in any base store.
| Parameters | |
sha:ObjectID | RawObjectID | SHA of the object |
| Returns | |
bool | True if object is packed 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[ | Iterable of object SHAs to retrieve |
includebool | Whether to include compressed data |
allowbool | If True, skip missing objects; if False, raise KeyError |
convertbool | Whether to convert OFS_DELTA objects |
| Returns | |
Iterator[ | Iterator of unpacked objects |
| Raises | |
KeyError | If 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[ | Iterable of object SHAs to retrieve |
allowbool | If True, skip missing objects; if False, raise KeyError |
| Returns | |
Iterator[ | Iterator of ShaFile objects |
| Raises | |
KeyError | If an object is missing and allow_missing is False |