Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/tests/test_loader.py
Show First 20 Lines • Show All 1,672 Lines • ▼ Show 20 Lines | def test_loader_svn_executable_property_on_svn_link_handling(swh_storage, tmp_path): | ||||
# the repository filesystem it reconstructed does not differ from a subversion | # the repository filesystem it reconstructed does not differ from a subversion | ||||
# export of that revision | # export of that revision | ||||
loader = SvnLoader(swh_storage, repo_url, temp_directory=tmp_path, check_revision=1) | loader = SvnLoader(swh_storage, repo_url, temp_directory=tmp_path, check_revision=1) | ||||
assert loader.load() == {"status": "eventful"} | assert loader.load() == {"status": "eventful"} | ||||
assert_last_visit_matches( | assert_last_visit_matches( | ||||
loader.storage, repo_url, status="full", type="svn", | loader.storage, repo_url, status="full", type="svn", | ||||
) | ) | ||||
def test_loader_svn_add_property_on_link(swh_storage, tmp_path): | |||||
# create a repository | |||||
repo_path = os.path.join(tmp_path, "tmprepo") | |||||
repos.create(repo_path) | |||||
repo_url = f"file://{repo_path}" | |||||
# first commit | |||||
add_commit( | |||||
repo_url, | |||||
"Add an executable file and a svn link to it.", | |||||
[ | |||||
CommitChange( | |||||
change_type=CommitChangeType.AddOrUpdate, | |||||
path="hello-world", | |||||
properties={"svn:executable": "*"}, | |||||
data=b"#!/bin/bash\necho Hello World !", | |||||
), | |||||
CommitChange( | |||||
change_type=CommitChangeType.AddOrUpdate, | |||||
path="hello", | |||||
properties={"svn:special": "*"}, | |||||
data=b"link hello-world", | |||||
), | |||||
], | |||||
) | |||||
# second commit | |||||
add_commit( | |||||
repo_url, | |||||
"Set svn:eol-style property on link", | |||||
[ | |||||
CommitChange( | |||||
change_type=CommitChangeType.AddOrUpdate, | |||||
path="hello", | |||||
properties={"svn:eol-style": "native"}, | |||||
), | |||||
], | |||||
) | |||||
# instantiate a svn loader checking after each processed revision that | |||||
# the repository filesystem it reconstructed does not differ from a subversion | |||||
# export of that revision | |||||
loader = SvnLoader(swh_storage, repo_url, temp_directory=tmp_path, check_revision=1) | |||||
assert loader.load() == {"status": "eventful"} | |||||
assert_last_visit_matches( | |||||
loader.storage, repo_url, status="full", type="svn", | |||||
ardumont: is it enough a check?
I assume that yes and without the current implementation change, this… | |||||
Done Inline ActionsYes without the change, revision discrepancy got detected when loading the repository. anlambert: Yes without the change, revision discrepancy got detected when loading the repository. | |||||
) |
is it enough a check?
I assume that yes and without the current implementation change, this breaks. Am I correct?