class documentation
class MemoryPackIndex(PackIndex):
Constructors: MemoryPackIndex.clone(other_index), MemoryPackIndex.for_pack(pack_data), MemoryPackIndex(entries, object_format, pack_checksum)
Pack index that is stored entirely in memory.
| Class Method | clone |
Create a copy of another PackIndex in memory. |
| Class Method | for |
Create a MemoryPackIndex from a PackData object. |
| Method | __init__ |
Create a new MemoryPackIndex. |
| Method | __len__ |
Return the number of entries in this pack index. |
| Method | get |
Return the SHA checksum stored for the corresponding packfile. |
| Method | iterentries |
Iterate over all index entries. |
| Method | object |
Return the offset for the given SHA. |
| Method | object |
Return the SHA1 for the object at the given offset. |
| Instance Variable | object |
Undocumented |
| Method | _itersha |
Iterate over all SHA1s in the index. |
| Instance Variable | _by |
Undocumented |
| Instance Variable | _by |
Undocumented |
| Instance Variable | _entries |
Undocumented |
| Instance Variable | _pack |
Undocumented |
Inherited from PackIndex:
| Method | __eq__ |
Check equality with another PackIndex. |
| Method | __iter__ |
Iterate over the SHAs in this pack. |
| Method | __ne__ |
Check if this pack index is not equal to another. |
| Method | check |
Check the consistency of this pack index. |
| Method | close |
Close any open files. |
| Method | iter |
Iterate over all SHA1s with the given prefix. |
| Method | objects |
Return the hex SHA1 over all the shas of all objects in this pack. |
| Method | _object |
See object_offset. |
def __init__(self, entries:
list[ PackIndexEntry], object_format: ObjectFormat, pack_checksum: bytes | None = None):
¶
Create a new MemoryPackIndex.
| Parameters | |
entries:list[ | Sequence of name, idx, crc32 (sorted) |
objectObjectFormat | Object format used by this index |
packbytes | None | Optional pack checksum |
overrides
dulwich.pack.PackIndex.get_pack_checksumReturn the SHA checksum stored for the corresponding packfile.
overrides
dulwich.pack.PackIndex.object_offsetReturn the offset for the given SHA.
Returns: Offset in the pack file
| Parameters | |
sha:ObjectID | RawObjectID | SHA to look up (binary or hex) |
| Returns | |
int | Undocumented |