Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/svn.py
# Copyright (C) 2015-2022 The Software Heritage developers | # Copyright (C) 2015-2022 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
"""SVN client in charge of iterating over svn logs and yield commit | """SVN client in charge of iterating over svn logs and yield commit | ||||
representations including the hash tree/content computations per svn | representations including the hash tree/content computations per svn | ||||
commit. | commit. | ||||
""" | """ | ||||
import logging | import logging | ||||
import os | import os | ||||
import shutil | import shutil | ||||
import tempfile | import tempfile | ||||
from typing import Dict, Iterator, List, Optional, Tuple, Union | from typing import Dict, Iterator, List, Optional, Tuple, Union | ||||
from urllib.parse import urlparse, urlunparse | from urllib.parse import quote, urlparse, urlunparse | ||||
from subvertpy import SubversionException, client, properties, wc | from subvertpy import SubversionException, client, properties, wc | ||||
from subvertpy.ra import ( | from subvertpy.ra import ( | ||||
Auth, | Auth, | ||||
RemoteAccess, | RemoteAccess, | ||||
get_simple_prompt_provider, | get_simple_prompt_provider, | ||||
get_username_provider, | get_username_provider, | ||||
) | ) | ||||
Show All 13 Lines | |||||
# When log message contains empty data | # When log message contains empty data | ||||
DEFAULT_AUTHOR_MESSAGE = "" | DEFAULT_AUTHOR_MESSAGE = "" | ||||
logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||
def quote_svn_url(url: str) -> str: | def quote_svn_url(url: str) -> str: | ||||
return url.replace(" ", "%20").replace("#", "%23") | return quote(url, safe="/:!$&'()*+,=@") | ||||
class SvnRepo: | class SvnRepo: | ||||
"""Svn repository representation. | """Svn repository representation. | ||||
Args: | Args: | ||||
remote_url: Remove svn repository url | remote_url: Remove svn repository url | ||||
origin_url: Associated origin identifier | origin_url: Associated origin identifier | ||||
▲ Show 20 Lines • Show All 559 Lines • Show Last 20 Lines |