Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/git/from_disk.py
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | class GitLoaderFromDisk(UnbufferedLoader): | ||||
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['max_content_size'] | ||||
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')) | ||||
for oid in missing_contents: | for oid in missing_contents: | ||||
yield converters.dulwich_blob_to_content( | yield converters.dulwich_blob_to_content( | ||||
self.repo[hashutil.hash_to_bytehex(oid)], log=self.log, | self.repo[hashutil.hash_to_bytehex(oid)], log=self.log, | ||||
max_content_size=max_content_size, | max_content_size=max_content_size, | ||||
▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines |