Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/storage/archive.py
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | def snapshot_get_heads(self, id: Sha1Git) -> Iterable[Sha1Git]: | ||||
revisions: Set[Tuple[datetime, Sha1Git]] = set() | revisions: Set[Tuple[datetime, Sha1Git]] = set() | ||||
for targets in grouper(targets_set, batchsize): | for targets in grouper(targets_set, batchsize): | ||||
revisions.update( | revisions.update( | ||||
(revision.date.to_datetime(), revision.id) | (revision.date.to_datetime(), revision.id) | ||||
for revision in self.storage.revision_get(list(targets)) | for revision in self.storage.revision_get(list(targets)) | ||||
if revision is not None and revision.date is not None | if revision is not None and revision.date is not None | ||||
) | ) | ||||
yield from (head for _, head in sorted(revisions)) | yield from (head for _, head in revisions) |