Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/storage.py
Show First 20 Lines • Show All 1,634 Lines • ▼ Show 20 Lines | def object_find_by_sha1_git(self, ids, db=None, cur=None): | ||||
ids: a generator of sha1_gits | ids: a generator of sha1_gits | ||||
Returns: | Returns: | ||||
dict: a mapping from id to the list of objects found. Each object | dict: a mapping from id to the list of objects found. Each object | ||||
found is itself a dict with keys: | found is itself a dict with keys: | ||||
- sha1_git: the input id | - sha1_git: the input id | ||||
- type: the type of object found | - type: the type of object found | ||||
- id: the id of the object found | |||||
- object_id: the numeric id of the object found. | |||||
""" | """ | ||||
ret = {id: [] for id in ids} | ret = {id: [] for id in ids} | ||||
for retval in db.object_find_by_sha1_git(ids, cur=cur): | for retval in db.object_find_by_sha1_git(ids, cur=cur): | ||||
if retval[1]: | if retval[1]: | ||||
ret[retval[0]].append(dict(zip(db.object_find_by_sha1_git_cols, | ret[retval[0]].append(dict(zip(db.object_find_by_sha1_git_cols, | ||||
retval))) | retval))) | ||||
▲ Show 20 Lines • Show All 489 Lines • Show Last 20 Lines |