class PackIndex(object):
Known subclasses: dulwich.pack.FilePackIndex
, dulwich.pack.MemoryPackIndex
An index in to a packfile.
Given a sha id of an object a pack index can tell you the location in the packfile of that object if it has it.
Method | __eq__ |
Undocumented |
Method | __iter__ |
Iterate over the SHAs in this pack. |
Method | __len__ |
Return the number of entries in this pack index. |
Method | __ne__ |
Undocumented |
Method | get |
Return the SHA1 checksum stored for the corresponding packfile. |
Method | iterentries |
Iterate over the entries in this pack index. |
Method | object |
Return the index in to the corresponding packfile for the object. |
Method | object |
Return the SHA1 corresponding to the index in the pack file. |
Method | objects |
Return the hex SHA1 over all the shas of all objects in this pack. |
Method | _itersha |
Yield all the SHA1's of the objects in the index, sorted. |
Method | _object |
See object_index. |
dulwich.pack.FilePackIndex
, dulwich.pack.MemoryPackIndex
Return the number of entries in this pack index.
dulwich.pack.FilePackIndex
, dulwich.pack.MemoryPackIndex
Return the SHA1 checksum stored for the corresponding packfile.
Returns: 20-byte binary digest
dulwich.pack.FilePackIndex
, dulwich.pack.MemoryPackIndex
Iterate over the entries in this pack index.
- Returns: iterator over tuples with object name, offset in packfile and
- crc32 checksum.
dulwich.pack.FilePackIndex
, dulwich.pack.MemoryPackIndex
Return the index in to the corresponding packfile for the object.
Given the name of an object it will return the offset that object lives at within the corresponding pack file. If the pack file doesn't have the object then None will be returned.
dulwich.pack.MemoryPackIndex
Return the SHA1 corresponding to the index in the pack file.
Return the hex SHA1 over all the shas of all objects in this pack.
Note: This is used for the filename of the pack.
dulwich.pack.FilePackIndex
, dulwich.pack.MemoryPackIndex
Yield all the SHA1's of the objects in the index, sorted.
dulwich.pack.FilePackIndex
See object_index.
Parameters | |
sha | A binary SHA string. (20 characters long)_ |