Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/loader.py
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | ) -> Optional[Tuple[Snapshot, Revision]]: | ||||
return None | return None | ||||
branch = branches.get(DEFAULT_BRANCH) | branch = branches.get(DEFAULT_BRANCH) | ||||
if not branch: | if not branch: | ||||
return None | return None | ||||
if branch.target_type != TargetType.REVISION: | if branch.target_type != TargetType.REVISION: | ||||
return None | return None | ||||
swh_id = branch.target | swh_id = branch.target | ||||
revs = list(storage.revision_get([swh_id])) | revision = storage.revision_get([swh_id])[0] | ||||
if not revs or revs[0] is None: | if not revision: | ||||
return None | return None | ||||
return latest_snapshot, Revision.from_dict(revs[0]) | return latest_snapshot, revision | ||||
def build_swh_revision(self, rev, commit, dir_id, parents): | def build_swh_revision(self, rev, commit, dir_id, parents): | ||||
"""Build the swh revision dictionary. | """Build the swh revision dictionary. | ||||
This adds: | This adds: | ||||
- the `'synthetic`' flag to true | - the `'synthetic`' flag to true | ||||
- the '`extra_headers`' containing the repository's uuid and the | - the '`extra_headers`' containing the repository's uuid and the | ||||
▲ Show 20 Lines • Show All 553 Lines • Show Last 20 Lines |