MCPcopy
hub / github.com/borgbackup/borg / decompress_entry

Method decompress_entry

src/borg/cache.py:441–455  ·  view source on GitHub ↗

reverse operation of compress_entry

(self, entry_packed)

Source from the content-addressed store, hash-verified

439 return msgpack.packb(entry)
440
441 def decompress_entry(self, entry_packed):
442 """reverse operation of compress_entry"""
443 assert isinstance(self.chunks, ChunkIndex), f"{self.chunks} is not a ChunkIndex"
444 assert isinstance(entry_packed, bytes)
445 entry = msgpack.unpackb(entry_packed)
446 entry = FileCacheEntry(*entry)
447 chunks = []
448 for idx in entry.chunks:
449 assert isinstance(idx, int), f"{idx} is not an int"
450 id = self.chunks.idx_to_k(idx)
451 cie = self.chunks[id]
452 assert cie.size > 0
453 chunks.append((id, cie.size))
454 entry = entry._replace(chunks=chunks)
455 return entry
456
457 @property
458 def files(self):

Callers 2

_write_files_cacheMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected