Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/git/loader.py
Show First 20 Lines • Show All 303 Lines • ▼ Show 20 Lines | def get_content_ids(self) -> Iterable[Dict[str, Any]]: | ||||
if raw_obj.type_name != b"blob": | if raw_obj.type_name != b"blob": | ||||
continue | continue | ||||
yield converters.dulwich_blob_to_content_id(raw_obj) | yield converters.dulwich_blob_to_content_id(raw_obj) | ||||
def get_contents(self) -> Iterable[BaseContent]: | def get_contents(self) -> Iterable[BaseContent]: | ||||
"""Format the blobs from the git repository as swh contents""" | """Format the blobs from the git repository as swh contents""" | ||||
missing_contents = set( | missing_contents = set( | ||||
self.storage.content_missing(self.get_content_ids(), "sha1_git") | self.storage.content_missing(list(self.get_content_ids()), "sha1_git") | ||||
) | ) | ||||
for raw_obj in self.get_inflater(): | for raw_obj in self.get_inflater(): | ||||
if raw_obj.type_name != b"blob": | if raw_obj.type_name != b"blob": | ||||
continue | continue | ||||
if raw_obj.sha().digest() not in missing_contents: | if raw_obj.sha().digest() not in missing_contents: | ||||
continue | continue | ||||
▲ Show 20 Lines • Show All 201 Lines • Show Last 20 Lines |