Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/mercurial/tests/test_loader.py
Show First 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | for branch in snapshot.branches.values(): | ||||
continue | continue | ||||
revisions.append(branch.target) | revisions.append(branch.target) | ||||
# extract original changesets info and the transplant sources | # extract original changesets info and the transplant sources | ||||
hg_changesets = set() | hg_changesets = set() | ||||
transplant_sources = set() | transplant_sources = set() | ||||
for rev in loader.storage.revision_log(revisions): | for rev in loader.storage.revision_log(revisions): | ||||
hg_changesets.add(rev["metadata"]["node"]) | hg_changesets.add(rev["metadata"]["node"]) | ||||
for k, v in rev["metadata"]["extra_headers"]: | for k, v in rev["extra_headers"]: | ||||
if k == "transplant_source": | if k == b"transplant_source": | ||||
transplant_sources.add(v.decode("ascii")) | transplant_sources.add(v.decode("ascii")) | ||||
# check extracted data are valid | # check extracted data are valid | ||||
assert len(hg_changesets) > 0 | assert len(hg_changesets) > 0 | ||||
assert len(transplant_sources) > 0 | assert len(transplant_sources) > 0 | ||||
assert transplant_sources.issubset(hg_changesets) | assert transplant_sources.issubset(hg_changesets) | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |