Skip to content
Snippets Groups Projects
Commit 6eb0e18f authored by Antoine Lambert's avatar Antoine Lambert
Browse files

loader: Fix subversion sub-project dump URL

Previously SvnLoaderFromRemoteDump class was using the repository
root URL to dump a sub-project.
parent 15280d5d
No related branches found
Tags v1.6.0
1 merge request!214loader: Fix subversion sub-project dump URL
Pipeline #1277 passed
......@@ -856,6 +856,7 @@ class SvnLoaderFromRemoteDump(SvnLoader):
self.temp_dir,
self.max_content_size,
debug=self.debug,
from_dump=True,
)
# Ensure to use remote URL retrieved by SvnRepo as origin URL might redirect
......
......@@ -1931,7 +1931,9 @@ def test_loader_svn_add_property_on_directory_link(
@pytest.mark.parametrize(
"svn_loader_cls", [SvnLoader, SvnLoaderFromDumpArchive, SvnLoaderFromRemoteDump]
)
def test_loader_with_subprojects(swh_storage, repo_url, tmp_path, svn_loader_cls):
def test_loader_with_subprojects(
swh_storage, repo_url, tmp_path, svn_loader_cls, mocker
):
# first commit
add_commit(
......@@ -1991,6 +1993,9 @@ def test_loader_with_subprojects(swh_storage, repo_url, tmp_path, svn_loader_cls
loader = svn_loader_cls(**loader_params)
if svn_loader_cls == SvnLoaderFromRemoteDump:
dump_revisions = mocker.spy(loader, "dump_svn_revisions")
assert loader.load() == {"status": "eventful"}
assert_last_visit_matches(
loader.storage,
......@@ -2000,6 +2005,9 @@ def test_loader_with_subprojects(swh_storage, repo_url, tmp_path, svn_loader_cls
)
check_snapshot(loader.snapshot, loader.storage)
if svn_loader_cls == SvnLoaderFromRemoteDump:
dump_revisions.assert_called_once_with(origin_url.rstrip("/"), -1)
if svn_loader_cls == SvnLoaderFromDumpArchive:
loader_params["archive_path"] = _dump_project(tmp_path, origin_url)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment