# but that's okay because we'll flush it in _end().
oneblob = ''.join(datalist)
f.write(oneblob)
---- self.outbytes += len(oneblob)
++++ nw = len(oneblob)
++++ crc = zlib.crc32(oneblob) & 0xffffffff
++++ self._update_idx(sha, crc, nw)
++++ self.outbytes += nw
self.count += 1
- def _write(self, bin, type, content):
++++ return nw, crc
++ +
-- - def _write(self, bin, type, content):
++++ def _update_idx(self, sha, crc, size):
++++ assert(sha)
++++ if self.idx:
++++ self.idx[ord(sha[0])].append((sha, crc, self.file.tell() - size))
+
++++ def _write(self, sha, type, content):
if verbose:
log('>')
---- self._raw_write(_encode_packobj(type, content))
---- return bin
++++ if not sha:
++++ sha = calc_hash(type, content)
++++ size, crc = self._raw_write(_encode_packobj(type, content), sha=sha)
++++ return sha
def breakpoint(self):
"""Clear byte and object counts and return the last processed id."""