Skip to content

Commit 266abf8

Browse files
committed
refactor!(pytest plugin[svn]) Cache svn_repo
1 parent d782b66 commit 266abf8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/libvcs/pytest_plugin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,17 @@ def hg_repo(projects_path: pathlib.Path, hg_remote_repo: pathlib.Path) -> HgSync
673673
@pytest.fixture
674674
def svn_repo(projects_path: pathlib.Path, svn_remote_repo: pathlib.Path) -> SvnSync:
675675
"""Pre-made svn clone of remote repo checked out to user's projects dir."""
676+
remote_repo_name = unique_repo_name(remote_repos_path=projects_path)
677+
new_checkout_path = projects_path / remote_repo_name
678+
master_copy = projects_path / "svn_repo"
679+
680+
if master_copy.exists():
681+
shutil.copytree(master_copy, new_checkout_path)
682+
return SvnSync(
683+
url=f"file://{svn_remote_repo}",
684+
path=str(new_checkout_path),
685+
)
686+
676687
svn_repo = SvnSync(
677688
url=f"file://{svn_remote_repo}",
678689
path=str(projects_path / "svn_repo"),

0 commit comments

Comments
 (0)