Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/loader.py
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | ): | ||||
incremental: If True, the default, starts from the last snapshot (if any). | incremental: If True, the default, starts from the last snapshot (if any). | ||||
Otherwise, starts from the initial commit of the repository. | Otherwise, starts from the initial commit of the repository. | ||||
temp_directory: The temporary directory to use as root directory for working | temp_directory: The temporary directory to use as root directory for working | ||||
directory computations | directory computations | ||||
debug: If true, run the loader in debug mode. At the end of the loading, the | debug: If true, run the loader in debug mode. At the end of the loading, the | ||||
temporary working directory is not cleaned up to ease inspection. | temporary working directory is not cleaned up to ease inspection. | ||||
Defaults to false. | Defaults to false. | ||||
check_revision: The number of svn commits between checks for hash divergence | check_revision: The number of svn commits between checks for hash divergence | ||||
max_content_size: Default max content size allowed | |||||
""" | """ | ||||
# technical svn uri to act on svn repository | # technical svn uri to act on svn repository | ||||
self.svn_url = url | self.svn_url = url | ||||
# origin url as unique identifier for origin in swh archive | # origin url as unique identifier for origin in swh archive | ||||
origin_url = origin_url or self.svn_url | origin_url = origin_url or self.svn_url | ||||
super().__init__(storage=storage, origin_url=origin_url, **kwargs) | super().__init__(storage=storage, origin_url=origin_url, **kwargs) | ||||
self.debug = debug | self.debug = debug | ||||
▲ Show 20 Lines • Show All 461 Lines • ▼ Show 20 Lines | def __init__( | ||||
url: str, | url: str, | ||||
archive_path: str, | archive_path: str, | ||||
origin_url: Optional[str] = None, | origin_url: Optional[str] = None, | ||||
incremental: bool = False, | incremental: bool = False, | ||||
visit_date: Optional[datetime] = None, | visit_date: Optional[datetime] = None, | ||||
temp_directory: str = "/tmp", | temp_directory: str = "/tmp", | ||||
debug: bool = False, | debug: bool = False, | ||||
check_revision: int = 0, | check_revision: int = 0, | ||||
max_content_size: Optional[int] = None, | **kwargs: Any, | ||||
ardumont: i think this one can go away as well now (same for the next one).
(It's dealt with in the base… | |||||
Done Inline ActionsRight and I also forgot to forward the extra keyword parameters to base constructor. anlambert: Right and I also forgot to forward the extra keyword parameters to base constructor. | |||||
): | ): | ||||
super().__init__( | super().__init__( | ||||
storage=storage, | storage=storage, | ||||
url=url, | url=url, | ||||
origin_url=origin_url, | origin_url=origin_url, | ||||
incremental=incremental, | incremental=incremental, | ||||
visit_date=visit_date, | visit_date=visit_date, | ||||
temp_directory=temp_directory, | temp_directory=temp_directory, | ||||
debug=debug, | debug=debug, | ||||
check_revision=check_revision, | check_revision=check_revision, | ||||
max_content_size=max_content_size, | **kwargs, | ||||
) | ) | ||||
self.archive_path = archive_path | self.archive_path = archive_path | ||||
self.temp_dir = None | self.temp_dir = None | ||||
self.repo_path = None | self.repo_path = None | ||||
self.from_dump = True | self.from_dump = True | ||||
def prepare(self): | def prepare(self): | ||||
self.log.info("Archive to mount and load %s", self.archive_path) | self.log.info("Archive to mount and load %s", self.archive_path) | ||||
Show All 29 Lines | def __init__( | ||||
storage: StorageInterface, | storage: StorageInterface, | ||||
url: str, | url: str, | ||||
origin_url: Optional[str] = None, | origin_url: Optional[str] = None, | ||||
incremental: bool = True, | incremental: bool = True, | ||||
visit_date: Optional[datetime] = None, | visit_date: Optional[datetime] = None, | ||||
temp_directory: str = "/tmp", | temp_directory: str = "/tmp", | ||||
debug: bool = False, | debug: bool = False, | ||||
check_revision: int = 0, | check_revision: int = 0, | ||||
max_content_size: Optional[int] = None, | **kwargs: Any, | ||||
): | ): | ||||
super().__init__( | super().__init__( | ||||
storage=storage, | storage=storage, | ||||
url=url, | url=url, | ||||
origin_url=origin_url, | origin_url=origin_url, | ||||
incremental=incremental, | incremental=incremental, | ||||
visit_date=visit_date, | visit_date=visit_date, | ||||
temp_directory=temp_directory, | temp_directory=temp_directory, | ||||
debug=debug, | debug=debug, | ||||
check_revision=check_revision, | check_revision=check_revision, | ||||
max_content_size=max_content_size, | **kwargs, | ||||
) | ) | ||||
self.from_dump = True | self.from_dump = True | ||||
self.temp_dir = self._create_tmp_dir(self.temp_directory) | self.temp_dir = self._create_tmp_dir(self.temp_directory) | ||||
self.repo_path = None | self.repo_path = None | ||||
self.truncated_dump = False | self.truncated_dump = False | ||||
def get_last_loaded_svn_rev(self, svn_url: str) -> int: | def get_last_loaded_svn_rev(self, svn_url: str) -> int: | ||||
"""Check if the svn repository has already been visited and return the last | """Check if the svn repository has already been visited and return the last | ||||
▲ Show 20 Lines • Show All 179 Lines • Show Last 20 Lines |
i think this one can go away as well now (same for the next one).
(It's dealt with in the base loader class).