Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/git/loader.py
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | class GitLoader(base.BaseLoader): | ||||
def has_contents(self): | def has_contents(self): | ||||
"""Checks whether we need to load contents""" | """Checks whether we need to load contents""" | ||||
return bool(self.type_to_ids[b'blob']) | return bool(self.type_to_ids[b'blob']) | ||||
def get_content_ids(self): | def get_content_ids(self): | ||||
"""Get the content identifiers from the git repository""" | """Get the content identifiers from the git repository""" | ||||
for oid in self.type_to_ids[b'blob']: | for oid in self.type_to_ids[b'blob']: | ||||
yield converters.dulwich_blob_to_content_id(self.repo[oid]) | yield converters.dulwich_blob_to_content_id(self.repo[oid]) | ||||
def get_contents(self): | def get_contents(self): | ||||
"""Get the contents that need to be loaded""" | """Get the contents that need to be loaded""" | ||||
max_content_size = self.config['content_size_limit'] | max_content_size = self.config['content_size_limit'] | ||||
missing_contents = set(self.storage.content_missing( | missing_contents = set(self.storage.content_missing( | ||||
self.get_content_ids(), 'sha1_git')) | self.get_content_ids(), 'sha1_git')) | ||||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |