Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/storage/in_memory.py
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | def content_ctags_add(self, ctags, conflict_update=False): | ||||
results | results | ||||
""" | """ | ||||
for item in ctags: | for item in ctags: | ||||
tool_id = item['indexer_configuration_id'] | tool_id = item['indexer_configuration_id'] | ||||
if conflict_update: | if conflict_update: | ||||
item_ctags = [] | item_ctags = [] | ||||
else: | else: | ||||
# TODO: this merges old ctags with new ctags. This is | # merge old ctags with new ctags | ||||
# pointless, new ctags should replace the old ones. | |||||
existing = list(self._content_ctags.get([item['id']])) | existing = list(self._content_ctags.get([item['id']])) | ||||
item_ctags = [ | item_ctags = [ | ||||
{ | { | ||||
key: ctags_item[key] | key: ctags_item[key] | ||||
for key in ('name', 'kind', 'line', 'lang') | for key in ('name', 'kind', 'line', 'lang') | ||||
} | } | ||||
for existing_item in existing | for existing_item in existing | ||||
if existing_item['tool']['id'] == tool_id | if existing_item['tool']['id'] == tool_id | ||||
▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines |