Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/migrate_extrinsic_metadata.py
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | for visit in iter_origin_visits(storage, origin): | ||||
# Else, let's make sure the branch doesn't have any other revision | # Else, let's make sure the branch doesn't have any other revision | ||||
# Get the revision at the top of the branch. | # Get the revision at the top of the branch. | ||||
if branch.target in seen_revisions: | if branch.target in seen_revisions: | ||||
continue | continue | ||||
seen_revisions.add(branch.target) | seen_revisions.add(branch.target) | ||||
revision = storage.revision_get([branch.target])[0] | revision = storage.revision_get([branch.target])[0] | ||||
if revision is None: | |||||
# https://forge.softwareheritage.org/T997 | |||||
continue | |||||
# Check it's DSC (we only support those for now) | # Check it's DSC (we only support those for now) | ||||
assert ( | assert ( | ||||
revision.type == RevisionType.DSC | revision.type == RevisionType.DSC | ||||
), "non-DSC revisions are not supported" | ), "non-DSC revisions are not supported" | ||||
# Check it doesn't have parents (else we would have to | # Check it doesn't have parents (else we would have to | ||||
# recurse) | # recurse) | ||||
assert revision.parents == (), "DSC revision with parents" | assert revision.parents == (), "DSC revision with parents" | ||||
▲ Show 20 Lines • Show All 794 Lines • Show Last 20 Lines |