class documentation
class DumbHTTPObjectStore(BaseObjectStore):
Constructor: DumbHTTPObjectStore(base_url, http_request_func, object_format)
Object store implementation that fetches objects over dumb HTTP.
| Method | __contains__ |
Check if a particular object is present by SHA1. |
| Method | __del__ |
Warn if the object store is being deleted without closing. |
| Method | __init__ |
Initialize a DumbHTTPObjectStore. |
| Method | __iter__ |
Iterate over all SHAs in the store. |
| Method | add |
Add a single object to this object store. |
| Method | add |
Add a set of objects to this object store. |
| Method | close |
Close the object store and release resources. |
| Method | contains |
Check if a particular object is present by SHA1 and is loose. |
| Method | get |
Obtain the raw text for an object. |
| Instance Variable | base |
Undocumented |
| Property | packs |
Iterable of pack objects. |
| Method | _ensure |
Ensure we have a temporary directory for storing pack files. |
| Method | _fetch |
Try to fetch an object from pack files. |
| Method | _fetch |
Fetch a loose object by SHA. |
| Method | _fetch |
Fetch content from a URL path relative to base_url. |
| Method | _get |
Get or fetch a pack index. |
| Method | _load |
Load the list of available packs from the remote. |
| Instance Variable | _cached |
Undocumented |
| Instance Variable | _http |
Undocumented |
| Instance Variable | _packs |
Undocumented |
| Instance Variable | _temp |
Undocumented |
Inherited from BaseObjectStore:
| Method | __getitem__ |
Obtain an object by SHA1. |
| Method | contains |
Check if a particular object is present by SHA1 and is packed. |
| 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 | iterobjects |
Iterate over a subset of objects in the store. |
| 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. |
def __init__(self, base_url:
str, http_request_func: Callable[ [ str, dict[ str, str]], tuple[ Any, Callable[ ..., bytes]]], object_format: ObjectFormat | None = None):
¶
Initialize a DumbHTTPObjectStore.
| Parameters | |
basestr | Base URL of the remote repository (e.g. "https://example.com/repo.git/") |
httpCallable[ | Function to make HTTP requests, should accept (url, headers) and return (response, read_func). |
objectObjectFormat | None | Object format to use (defaults to DEFAULT_OBJECT_FORMAT) |
Iterate over all SHAs in the store.
Note: This is inefficient for dumb HTTP as it requires downloading all pack indices.
def add_objects(self, objects:
Sequence[ tuple[ ShaFile, str | None]], progress: Callable[ [ str], None] | None = None) -> Pack | None:
¶
Add a set of objects to this object store.
Close the object store and release resources.
This method cleans up the temporary pack directory. Can be called multiple times safely.
Obtain the raw text for an object.
| Parameters | |
sha:RawObjectID | ObjectID | SHA1 of the object |
| Returns | |
tuple[ | Tuple with numeric type and object contents |