Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/git/dumb.py
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | def fetch_object_ids(self) -> None: | ||||
commit = commit_objects.pop() | commit = commit_objects.pop() | ||||
# fetch tree and blob ids recursively | # fetch tree and blob ids recursively | ||||
self._fetch_tree_objects(commit.tree) | self._fetch_tree_objects(commit.tree) | ||||
for parent in commit.parents: | for parent in commit.parents: | ||||
if ( | if ( | ||||
# commit not already seen in the current load | # commit not already seen in the current load | ||||
parent not in self.objects[b"commit"] | parent not in self.objects[b"commit"] | ||||
# commit not already archived by a previous load | # commit not already archived by a previous load | ||||
and parent not in self.base_repo.heads | and parent not in self.base_repo.local_heads | ||||
): | ): | ||||
commit_objects.append(cast(Commit, self._get_git_object(parent))) | commit_objects.append(cast(Commit, self._get_git_object(parent))) | ||||
self.objects[b"commit"].add(parent) | self.objects[b"commit"].add(parent) | ||||
def iter_objects(self, object_type: bytes) -> Iterable[ShaFile]: | def iter_objects(self, object_type: bytes) -> Iterable[ShaFile]: | ||||
"""Returns a generator on fetched git objects per type. | """Returns a generator on fetched git objects per type. | ||||
Args: | Args: | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |