refactor: name each variant by its md5 prefix

This commit is contained in:
Abdessamad Derraz committed 2026-11-24 12:15:39 +01:00
1 parent f6a509aacc
commit ed3f61db5d
321 files changed
+97 -23

No files matched your search

+1 -1
View File
@@ -65,7 +65,7 @@ def place_file(
if dest.exists() and dest.read_bytes() != data:
# Another revision under the same name: the collection keeps it
# beside, never in place of, the file already there.
dest = folder / ".variants" / f"{dest.name}.{sha1[:8]}"
dest = folder / ".variants" / f"{dest.name}.{hashlib.md5(data).hexdigest()[:8]}"
dest.parent.mkdir(parents=True, exist_ok=True)
with open(dest, "wb") as f:
f.write(data)