Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/migrate_extrinsic_metadata.py
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | for visit in iter_origin_visits(storage, origin): | ||||
for status in iter_origin_visit_statuses(storage, origin, visit.visit): | for status in iter_origin_visit_statuses(storage, origin, visit.visit): | ||||
if status.snapshot is None: | if status.snapshot is None: | ||||
continue | continue | ||||
if status.snapshot in seen_snapshots: | if status.snapshot in seen_snapshots: | ||||
continue | continue | ||||
seen_snapshots.add(status.snapshot) | seen_snapshots.add(status.snapshot) | ||||
snapshot = snapshot_get_all_branches(storage, status.snapshot) | snapshot = snapshot_get_all_branches(storage, status.snapshot) | ||||
for (branch_name, branch) in snapshot.branches.items(): | for (branch_name, branch) in snapshot.branches.items(): | ||||
if branch is None: | |||||
continue | |||||
# If it's the revision passed as argument, then it is indeed in the | # If it's the revision passed as argument, then it is indeed in the | ||||
# origin | # origin | ||||
if branch.target == revision_id: | if branch.target == revision_id: | ||||
return True | return True | ||||
# 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. | ||||
▲ Show 20 Lines • Show All 811 Lines • Show Last 20 Lines |