Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/git/loader.py
Show All 13 Lines | |||||
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type | from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type | ||||
import dulwich.client | import dulwich.client | ||||
from dulwich.object_store import ObjectStoreGraphWalker | from dulwich.object_store import ObjectStoreGraphWalker | ||||
from dulwich.pack import PackData, PackInflater | from dulwich.pack import PackData, PackInflater | ||||
from swh.core.config import merge_configs | from swh.core.config import merge_configs | ||||
from swh.loader.core.loader import DVCSLoader | from swh.loader.core.loader import DVCSLoader | ||||
from swh.loader.exception import NotFound | |||||
from swh.model import hashutil | from swh.model import hashutil | ||||
from swh.model.model import ( | from swh.model.model import ( | ||||
BaseContent, | BaseContent, | ||||
Directory, | Directory, | ||||
Origin, | Origin, | ||||
Release, | Release, | ||||
Revision, | Revision, | ||||
Sha1Git, | Sha1Git, | ||||
▲ Show 20 Lines • Show All 200 Lines • ▼ Show 20 Lines | class GitLoader(DVCSLoader): | ||||
def fetch_data(self) -> bool: | def fetch_data(self) -> bool: | ||||
assert self.origin is not None | assert self.origin is not None | ||||
def do_progress(msg: bytes) -> None: | def do_progress(msg: bytes) -> None: | ||||
sys.stderr.buffer.write(msg) | sys.stderr.buffer.write(msg) | ||||
sys.stderr.flush() | sys.stderr.flush() | ||||
try: | |||||
fetch_info = self.fetch_pack_from_origin( | fetch_info = self.fetch_pack_from_origin( | ||||
self.origin.url, self.base_snapshot, do_progress | self.origin.url, self.base_snapshot, do_progress | ||||
) | ) | ||||
except Exception as e: | |||||
raise NotFound(e) | |||||
self.pack_buffer = fetch_info.pack_buffer | self.pack_buffer = fetch_info.pack_buffer | ||||
self.pack_size = fetch_info.pack_size | self.pack_size = fetch_info.pack_size | ||||
self.remote_refs = fetch_info.remote_refs | self.remote_refs = fetch_info.remote_refs | ||||
self.symbolic_refs = fetch_info.symbolic_refs | self.symbolic_refs = fetch_info.symbolic_refs | ||||
self.log.info( | self.log.info( | ||||
vlorentz: could you include the actual errors, so the code is understandable without access to sentry? | |||||
Done Inline Actionsi did (in parenthesis just after the except). ardumont: i did (in parenthesis just after the except).
I guess that means i can drop the sentry urls. | |||||
"Listed %d refs for repo %s" % (len(self.remote_refs), self.origin.url), | "Listed %d refs for repo %s" % (len(self.remote_refs), self.origin.url), | ||||
extra={ | extra={ | ||||
"swh_type": "git_repo_list_refs", | "swh_type": "git_repo_list_refs", | ||||
"swh_repo": self.origin.url, | "swh_repo": self.origin.url, | ||||
"swh_num_refs": len(self.remote_refs), | "swh_num_refs": len(self.remote_refs), | ||||
}, | }, | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 263 Lines • Show Last 20 Lines |
could you include the actual errors, so the code is understandable without access to sentry?