Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/views/raw.py
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | def api_raw_object(request, swhid): | ||||
elif object_type == ObjectType.DIRECTORY: | elif object_type == ObjectType.DIRECTORY: | ||||
result = directory_get(archive.storage, object_id) | result = directory_get(archive.storage, object_id) | ||||
if result is None: | if result is None: | ||||
raise not_found() | raise not_found() | ||||
result = directory_git_object(result) | result = directory_git_object(result) | ||||
elif object_type == ObjectType.REVISION: | elif object_type == ObjectType.REVISION: | ||||
result = archive.storage.revision_get([object_id])[0] | result = archive.storage.revision_get([object_id], ignore_displayname=True)[0] | ||||
if result is None: | if result is None: | ||||
raise not_found() | raise not_found() | ||||
result = revision_git_object(result) | result = revision_git_object(result) | ||||
elif object_type == ObjectType.RELEASE: | elif object_type == ObjectType.RELEASE: | ||||
result = archive.storage.release_get([object_id])[0] | result = archive.storage.release_get([object_id], ignore_displayname=True)[0] | ||||
if result is None: | if result is None: | ||||
raise not_found() | raise not_found() | ||||
result = release_git_object(result) | result = release_git_object(result) | ||||
elif object_type == ObjectType.SNAPSHOT: | elif object_type == ObjectType.SNAPSHOT: | ||||
result = snapshot_get_all_branches(archive.storage, object_id) | result = snapshot_get_all_branches(archive.storage, object_id) | ||||
if result is None: | if result is None: | ||||
raise not_found() | raise not_found() | ||||
Show All 10 Lines |