byte_int, bytes_from_byte, bytes_from_uint,
environ,
ExitStack,
- items,
pending_raise,
- range,
reraise)
from bup.io import path_msg
from bup.helpers import (Sha1, add_error, chunkyreader, debug1, debug2,
repodir = None # The default repository, once initialized
_typemap = {b'blob': 3, b'tree': 2, b'commit': 1, b'tag': 4}
-_typermap = {v: k for k, v in items(_typemap)}
+_typermap = {v: k for k, v in _typemap.items()}
_total_searches = 0
return (type, zlib.decompress(buf[i+1:]))
-class PackIdx:
- def __init__(self):
- assert(0)
-
+class PackIdx(object):
def find_offset(self, hash):
"""Get the offset of an object inside the index file."""
idx = self._idx_from_hash(hash)
class PackIdxV1(PackIdx):
"""Object representation of a Git pack index (version 1) file."""
def __init__(self, filename, f):
+ super(PackIdxV1, self).__init__()
self.closed = False
self.name = filename
self.idxnames = [self.name]
class PackIdxV2(PackIdx):
"""Object representation of a Git pack index (version 2) file."""
def __init__(self, filename, f):
+ super(PackIdxV2, self).__init__()
self.closed = False
self.name = filename
self.idxnames = [self.name]