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

Method do_debug_id_hash

src/borg/archiver/debug_cmd.py:217–223  ·  view source on GitHub ↗

Computes id-hash for file contents.

(self, args, repository, manifest)

Source from the content-addressed store, hash-verified

215
216 @with_repository(compatibility=Manifest.NO_OPERATION_CHECK)
217 def do_debug_id_hash(self, args, repository, manifest):
218 """Computes id-hash for file contents."""
219 with open(args.path, "rb") as f:
220 data = f.read()
221 key = manifest.key
222 id = key.id_hash(data)
223 print(id.hex())
224
225 @with_repository(compatibility=Manifest.NO_OPERATION_CHECK)
226 def do_debug_parse_obj(self, args, repository, manifest):

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
id_hashMethod · 0.45

Tested by

no test coverage detected