refactor: restore large files with one copy

model.largefiles.restore_verified replaces generate_db _restore and
release restore _copy_verified: a scratch copy beside the target,
hashed, then renamed into place with a plain mode.

generate_db now refuses to put back a cached asset whose copy does not
hash to its database entry. The entry is still kept, as for an asset
the cache cannot supply. The restore script copies once instead of
through a second scratch.
This commit is contained in:
Abdessamad Derraz committed 2026-11-20 20:03:26 +01:00
1 parent ab0805e6cb
commit 4dc4dc0429
5 files changed
+51 -61

No files matched your search

+1 -1
View File
@@ -55,7 +55,7 @@ class EveryWriterGoesThroughIt(unittest.TestCase):
for name, helper in (
("generate_pack.py", "write_text_atomic("),
("release_record.py", "write_text_atomic("),
("restore_large_files.py", "copy_file_atomic("),
("restore_large_files.py", "restore_verified("),
):
source = script_source(name)
with self.subTest(script=name):