Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9311982
D3741.id13168.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D3741.id13168.diff
View Options
diff --git a/swh/web/common/service.py b/swh/web/common/service.py
--- a/swh/web/common/service.py
+++ b/swh/web/common/service.py
@@ -1046,12 +1046,22 @@
A dict filled with the snapshot content.
"""
snapshot_id_bin = _to_sha1_bin(snapshot_id)
+ # not actually a snapshot, it's a dict with branches and a "next_branch" value.
snapshot = storage.snapshot_get_branches(
snapshot_id_bin, branches_from.encode(), branches_count, target_types
)
if not snapshot:
raise NotFoundExc("Snapshot with id %s not found!" % snapshot_id)
- return converters.from_snapshot(snapshot)
+ return converters.from_snapshot(
+ {
+ "id": snapshot["id"],
+ "branches": {
+ branch_name: branch.to_dict() if branch else None
+ for (branch_name, branch) in snapshot["branches"].items()
+ },
+ "next_branch": snapshot["next_branch"],
+ }
+ )
def lookup_latest_origin_snapshot(
diff --git a/swh/web/tests/conftest.py b/swh/web/tests/conftest.py
--- a/swh/web/tests/conftest.py
+++ b/swh/web/tests/conftest.py
@@ -298,7 +298,16 @@
branches_count,
target_types,
)
- return converters.from_snapshot(snp)
+ return converters.from_snapshot(
+ {
+ "id": snp["id"],
+ "branches": {
+ branch_name: branch.to_dict()
+ for (branch_name, branch) in snp["branches"].items()
+ },
+ "next_branch": None,
+ }
+ )
def snapshot_get_head(self, snapshot):
if snapshot["branches"]["HEAD"]["target_type"] == "alias":
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 2, 10:38 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3233115
Attached To
D3741: Update for the new type of snapshot_get_branches in swh-storage > 0.13.0
Event Timeline
Log In to Comment