Changeset View
Changeset View
Standalone View
Standalone View
swh/web/ui/service.py
Show First 20 Lines • Show All 247 Lines • ▼ Show 20 Lines | def lookup_revision_multiple(sha1_git_list): | ||||
""" | """ | ||||
def to_sha1_bin(sha1_hex): | def to_sha1_bin(sha1_hex): | ||||
_, sha1_git_bin = query.parse_hash_with_algorithms_or_throws( | _, sha1_git_bin = query.parse_hash_with_algorithms_or_throws( | ||||
sha1_hex, | sha1_hex, | ||||
['sha1'], | ['sha1'], | ||||
'Only sha1_git is supported.') | 'Only sha1_git is supported.') | ||||
return sha1_git_bin | return sha1_git_bin | ||||
sha1_bin_list = map(to_sha1_bin, sha1_git_list) | sha1_bin_list = (to_sha1_bin(x) for x in sha1_git_list) | ||||
ardumont: Note: This was to be symmetric with the generator below ^^ | |||||
revisions = backend.revision_get_multiple(sha1_bin_list) | revisions = backend.revision_get_multiple(sha1_bin_list) | ||||
return map(converters.from_revision, revisions) | return (converters.from_revision(x) for x in revisions) | ||||
ardumontUnsubmitted Not Done Inline ActionsNote: It was a fix because the serialization step (swh.web.ui.backend layer discussion with swh-storage) was not ok with map. ardumont: Note: It was a fix because the serialization step (`swh.web.ui.backend` layer discussion with… | |||||
def lookup_revision_message(rev_sha1_git): | def lookup_revision_message(rev_sha1_git): | ||||
"""Return the raw message of the revision with sha1 revision_sha1_git. | """Return the raw message of the revision with sha1 revision_sha1_git. | ||||
Args: | Args: | ||||
revision_sha1_git: The revision's sha1 as hexadecimal | revision_sha1_git: The revision's sha1 as hexadecimal | ||||
▲ Show 20 Lines • Show All 382 Lines • Show Last 20 Lines |
Note: This was to be symmetric with the generator below ^^