Changeset View
Changeset View
Standalone View
Standalone View
swh/vault/cookers/git_bare.py
Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | def push_subgraph(self, obj_type, obj_id) -> None: | ||||
else: | else: | ||||
raise NotImplementedError( | raise NotImplementedError( | ||||
f"GitBareCooker.queue_subgraph({obj_type!r}, ...)" | f"GitBareCooker.queue_subgraph({obj_type!r}, ...)" | ||||
) | ) | ||||
def load_objects(self) -> None: | def load_objects(self) -> None: | ||||
while self._rel_stack or self._rev_stack or self._dir_stack or self._cnt_stack: | while self._rel_stack or self._rev_stack or self._dir_stack or self._cnt_stack: | ||||
release_ids = self._pop(self._rel_stack, RELEASE_BATCH_SIZE) | release_ids = self._pop(self._rel_stack, RELEASE_BATCH_SIZE) | ||||
if release_ids: | |||||
self.load_releases(release_ids) | self.load_releases(release_ids) | ||||
revision_ids = self._pop(self._rev_stack, REVISION_BATCH_SIZE) | revision_ids = self._pop(self._rev_stack, REVISION_BATCH_SIZE) | ||||
if revision_ids: | |||||
self.load_revisions(revision_ids) | self.load_revisions(revision_ids) | ||||
directory_ids = self._pop(self._dir_stack, DIRECTORY_BATCH_SIZE) | directory_ids = self._pop(self._dir_stack, DIRECTORY_BATCH_SIZE) | ||||
if directory_ids: | |||||
self.load_directories(directory_ids) | self.load_directories(directory_ids) | ||||
content_ids = self._pop(self._cnt_stack, CONTENT_BATCH_SIZE) | content_ids = self._pop(self._cnt_stack, CONTENT_BATCH_SIZE) | ||||
if content_ids: | |||||
self.load_contents(content_ids) | self.load_contents(content_ids) | ||||
def push_revision_subgraph(self, obj_id: Sha1Git) -> None: | def push_revision_subgraph(self, obj_id: Sha1Git) -> None: | ||||
"""Fetches a revision and all its children, and writes them to disk""" | """Fetches a revision and all its children, and writes them to disk""" | ||||
loaded_from_graph = False | loaded_from_graph = False | ||||
if self.graph: | if self.graph: | ||||
from swh.graph.client import GraphArgumentException | from swh.graph.client import GraphArgumentException | ||||
▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines |