Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/tests/__init__.py
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | if revs: | ||||
missing_objs = ", ".join( | missing_objs = ", ".join( | ||||
str((object_to_branch[rev], rev.hex())) for rev in not_found | str((object_to_branch[rev], rev.hex())) for rev in not_found | ||||
) | ) | ||||
raise InexistentObjectsError( | raise InexistentObjectsError( | ||||
f"Branch/Revision(s) {missing_objs} should exist in storage" | f"Branch/Revision(s) {missing_objs} should exist in storage" | ||||
) | ) | ||||
# retrieve information from revision | # retrieve information from revision | ||||
for rev in revisions: | for rev in revisions: | ||||
assert rev is not None | |||||
objects_by_target_type[TargetType.DIRECTORY].append(rev["directory"]) | objects_by_target_type[TargetType.DIRECTORY].append(rev["directory"]) | ||||
object_to_branch[rev["directory"]] = rev["id"] | object_to_branch[rev["directory"]] = rev["id"] | ||||
rels = objects_by_target_type.get(TargetType.RELEASE) | rels = objects_by_target_type.get(TargetType.RELEASE) | ||||
if rels: | if rels: | ||||
not_found = list(storage.release_missing(rels)) | not_found = list(storage.release_missing(rels)) | ||||
if not_found: | if not_found: | ||||
missing_objs = ", ".join( | missing_objs = ", ".join( | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |