Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/data.py
Show First 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | for origin in _TEST_ORIGINS: | ||||
revisions.add(release.target) | revisions.add(release.target) | ||||
releases.add(hash_to_hex(branch_data.target)) | releases.add(hash_to_hex(branch_data.target)) | ||||
for rev_log in storage.revision_shortlog(set(revisions)): | for rev_log in storage.revision_shortlog(set(revisions)): | ||||
rev_id = rev_log[0] | rev_id = rev_log[0] | ||||
revisions.add(rev_id) | revisions.add(rev_id) | ||||
for rev in storage.revision_get(revisions): | for rev in storage.revision_get(revisions): | ||||
dir_id = rev["directory"] | if rev is None: | ||||
continue | |||||
dir_id = rev.directory | |||||
directories.add(hash_to_hex(dir_id)) | directories.add(hash_to_hex(dir_id)) | ||||
for entry in dir_iterator(storage, dir_id): | for entry in dir_iterator(storage, dir_id): | ||||
if entry["type"] == "file": | if entry["type"] == "file": | ||||
sha1s.add(entry["sha1"]) | sha1s.add(entry["sha1"]) | ||||
content_path[entry["sha1"]] = "/".join( | content_path[entry["sha1"]] = "/".join( | ||||
[hash_to_hex(dir_id), entry["path"].decode("utf-8")] | [hash_to_hex(dir_id), entry["path"].decode("utf-8")] | ||||
) | ) | ||||
elif entry["type"] == "dir": | elif entry["type"] == "dir": | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |