Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/cvs/loader.py
Show All 9 Lines | |||||
from datetime import datetime | from datetime import datetime | ||||
import os | import os | ||||
import os.path | import os.path | ||||
import subprocess | import subprocess | ||||
import tempfile | import tempfile | ||||
import time | import time | ||||
from typing import Any, BinaryIO, Dict, Iterator, List, Optional, Sequence, Tuple, cast | from typing import Any, BinaryIO, Dict, Iterator, List, Optional, Sequence, Tuple, cast | ||||
import sentry_sdk | |||||
from urllib3.util import parse_url | from urllib3.util import parse_url | ||||
from swh.loader.core.loader import BaseLoader | from swh.loader.core.loader import BaseLoader | ||||
from swh.loader.core.utils import clean_dangling_folders | from swh.loader.core.utils import clean_dangling_folders | ||||
from swh.loader.cvs.cvs2gitdump.cvs2gitdump import ( | from swh.loader.cvs.cvs2gitdump.cvs2gitdump import ( | ||||
CHANGESET_FUZZ_SEC, | CHANGESET_FUZZ_SEC, | ||||
ChangeSetKey, | ChangeSetKey, | ||||
CvsConv, | CvsConv, | ||||
▲ Show 20 Lines • Show All 517 Lines • ▼ Show 20 Lines | def fetch_data(self) -> bool: | ||||
assert self._last_revision is not None | assert self._last_revision is not None | ||||
self.snapshot = self.generate_and_load_snapshot(self._last_revision) | self.snapshot = self.generate_and_load_snapshot(self._last_revision) | ||||
self.log.info("SWH snapshot ID: %s", hashutil.hash_to_hex(self.snapshot.id)) | self.log.info("SWH snapshot ID: %s", hashutil.hash_to_hex(self.snapshot.id)) | ||||
self.flush() | self.flush() | ||||
self.loaded_snapshot_id = self.snapshot.id | self.loaded_snapshot_id = self.snapshot.id | ||||
return False | return False | ||||
except Exception: | except Exception: | ||||
self.log.exception("Exception in fetch_data:") | self.log.exception("Exception in fetch_data:") | ||||
sentry_sdk.capture_exception() | |||||
self._visit_status = "failed" | self._visit_status = "failed" | ||||
return False # Stopping iteration | return False # Stopping iteration | ||||
self._contents, self._skipped_contents, self._directories, rev = data | self._contents, self._skipped_contents, self._directories, rev = data | ||||
self._revisions = [rev] | self._revisions = [rev] | ||||
return True | return True | ||||
def build_swh_revision( | def build_swh_revision( | ||||
self, | self, | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |