diff --git a/swh/loader/svn/loader.py b/swh/loader/svn/loader.py --- a/swh/loader/svn/loader.py +++ b/swh/loader/svn/loader.py @@ -14,8 +14,9 @@ import shutil from subprocess import Popen import tempfile -from typing import Dict, Iterator, List, Optional, Tuple +from typing import Any, Dict, Iterator, List, Optional, Tuple +from swh.core.config import merge_configs from swh.loader.core.loader import BaseLoader from swh.loader.core.utils import clean_dangling_folders from swh.model import from_disk, hashutil @@ -45,6 +46,16 @@ TEMPORARY_DIR_PREFIX_PATTERN = "swh.loader.svn." +DEFAULT_CONFIG: Dict[str, Any] = { + "temp_directory": "/tmp", + "debug": False, # NOT FOR PRODUCTION: False for production + "check_revision": { + "status": False, # True: check the revision, False: don't check + "limit": 1000, # Periodicity check + }, +} + + class SvnLoader(BaseLoader): """Swh svn loader. @@ -53,20 +64,6 @@ """ - CONFIG_BASE_FILENAME = "loader/svn" - - ADDITIONAL_CONFIG = { - "temp_directory": ("str", "/tmp"), - "debug": ("bool", False), # NOT FOR PRODUCTION, False for production - "check_revision": ( - "dict", - { - "status": False, # do we check the revision? - "limit": 1000, # at which pace do we check it? - }, - ), - } - visit_type = "svn" def __init__( @@ -79,6 +76,7 @@ start_from_scratch=False, ): super().__init__(logging_class="swh.loader.svn.SvnLoader") + self.config = merge_configs(DEFAULT_CONFIG, self.config) # technical svn uri to act on svn repository self.svn_url = url # origin url as unique identifier for origin in swh archive diff --git a/swh/loader/svn/tests/conftest.py b/swh/loader/svn/tests/conftest.py --- a/swh/loader/svn/tests/conftest.py +++ b/swh/loader/svn/tests/conftest.py @@ -30,9 +30,6 @@ ], }, "check_revision": {"limit": 100, "status": False}, - "debug": False, "log_db": "dbname=softwareheritage-log", - "save_data": False, - "save_data_path": "", "temp_directory": "/tmp", }