class MemoryObjectStore(PackCapableObjectStore):
Constructor: MemoryObjectStore(object_format)
Object store that keeps all objects in memory.
| Method | __delitem__ |
Delete an object from this store, for testing only. |
| Method | __getitem__ |
Retrieve an object by SHA. |
| Method | __init__ |
Initialize a MemoryObjectStore. |
| Method | __iter__ |
Iterate over the SHAs that are present in this store. |
| Method | add |
Add a single object to this object store. |
| Method | add |
Add a set of objects to this object store. |
| Method | add |
Add a new pack to this object store. |
| Method | add |
Add pack data to this object store. |
| Method | add |
Add a new thin pack to this object store. |
| Method | contains |
Check if a particular object is present by SHA1 and is loose. |
| Method | contains |
Check if a particular object is present by SHA1 and is packed. |
| Method | get |
Obtain the raw text for an object. |
| Instance Variable | pack |
Undocumented |
| Property | packs |
List with pack objects. |
| Method | _to |
Undocumented |
| Instance Variable | _data |
Undocumented |
Inherited from PackCapableObjectStore:
| Method | get |
Get a raw unresolved object. |
| Method | iterobjects |
Iterate over a subset of objects. |
Inherited from BaseObjectStore (via PackCapableObjectStore):
| Method | __contains__ |
Check if a particular object is present 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 | iter |
Iterate over unpacked objects for a subset of SHAs. |
| 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. |
Retrieve an object by SHA.
| Parameters | |
name:ObjectID | RawObjectID | SHA of the object (as hex string or bytes) |
| Returns | |
ShaFile | Copy of the ShaFile object |
| Raises | |
KeyError | If the object is not found |
Initialize a MemoryObjectStore.
Creates an empty in-memory object store.
| Parameters | |
objectObjectFormat | None | Hash algorithm to use (defaults to SHA1) |
Add a new pack to this object store.
Because this object store doesn't support packs, we extract and add the individual objects.
- Returns: Fileobject to write to and a commit function to
- call when the pack is finished.
int, unpacked_objects: Iterator[ UnpackedObject], progress: Callable[ [ str], None] | None = None):
¶
Callable[ [ int], bytes], read_some: Callable[ [ int], bytes] | None, progress: Callable[ [ str], None] | None = None):
¶
Add a new thin pack to this object store.
Thin packs are packs that contain deltas with parents that exist outside the pack. Because this object store doesn't support packs, we extract and add the individual objects.
| Parameters | |
readCallable[ | Read function that blocks until the number of requested bytes are read. |
readCallable[ | Read function that returns at least one byte, but may not return the number of bytes requested. |
progress:Callable[ | Optional progress reporting function. |
Obtain the raw text for an object.
Returns: tuple with numeric type and object contents.
| Parameters | |
name:RawObjectID | ObjectID | sha for the object. |
| Returns | |
tuple[ | Undocumented |