class DeltaChainIterator(Generic[
Known subclasses: dulwich.pack.PackIndexer, dulwich.pack.PackInflater, dulwich.pack.UnpackedObjectIterator
Constructor: DeltaChainIterator(file_obj, hash_func, resolve_ext_ref)
Abstract iterator over pack data based on delta chains.
Each object in the pack is guaranteed to be inflated exactly once, regardless of how many objects reference it as a delta base. As a result, memory usage is proportional to the length of the longest delta chain.
Subclasses can override _result to define the result type of the iterator. By default, results are UnpackedObjects with the following members set:
- offset
- obj_type_num
- obj_chunks
- pack_type_num
- delta_base (for delta types)
- comp_chunks (if _include_comp is True)
- decomp_chunks
- decomp_len
- crc32 (if _compute_crc32 is True)
| Class Method | for |
Create a DeltaChainIterator from pack data. |
| Class Method | for |
Create a DeltaChainIterator for a subset of objects. |
| Method | __init__ |
Initialize DeltaChainIterator. |
| Method | __iter__ |
Iterate over objects in the pack. |
| Method | ext |
Return external references. |
| Method | record |
Record an unpacked object for later processing. |
| Method | set |
Set the pack data for iteration. |
| Instance Variable | hash |
Undocumented |
| Method | _ensure |
Undocumented |
| Method | _follow |
Undocumented |
| Method | _resolve |
Undocumented |
| Method | _result |
Undocumented |
| Method | _walk |
Undocumented |
| Method | _walk |
Undocumented |
| Class Variable | _compute |
Undocumented |
| Class Variable | _include |
Undocumented |
| Instance Variable | _ext |
Undocumented |
| Instance Variable | _file |
Undocumented |
| Instance Variable | _full |
Undocumented |
| Instance Variable | _pending |
Undocumented |
| Instance Variable | _pending |
Undocumented |
| Instance Variable | _resolve |
Undocumented |
PackData, resolve_ext_ref: ResolveExtRefFn | None = None) -> DeltaChainIterator[ T]:
¶
Create a DeltaChainIterator from pack data.
| Parameters | |
packPackData | PackData object to iterate |
resolveResolveExtRefFn | None | Optional function to resolve external refs |
| Returns | |
DeltaChainIterator[ | DeltaChainIterator instance |
Pack, shas: Iterable[ ObjectID | RawObjectID], *, allow_missing: bool = False, resolve_ext_ref: ResolveExtRefFn | None = None) -> DeltaChainIterator[ T]:
¶
Create a DeltaChainIterator for a subset of objects.
| Parameters | |
pack:Pack | Pack object containing the data |
shas:Iterable[ | Iterable of object SHAs to include |
allowbool | If True, skip missing objects |
resolveResolveExtRefFn | None | Optional function to resolve external refs |
| Returns | |
DeltaChainIterator[ | DeltaChainIterator instance |
Record an unpacked object for later processing.
| Parameters | |
unpacked:UnpackedObject | UnpackedObject to record |
int, obj_type_num: int, base_chunks: list[ bytes] | None) -> Iterator[ T]:
¶
Undocumented
int, obj_type_num: int, base_chunks: list[ bytes] | None) -> UnpackedObject:
¶
Undocumented
dulwich.pack.PackIndexer, dulwich.pack.PackInflater, dulwich.pack.UnpackedObjectIteratorUndocumented