File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -653,11 +653,26 @@ def git_repo(
653
653
654
654
655
655
@pytest .fixture
656
- def hg_repo (projects_path : pathlib .Path , hg_remote_repo : pathlib .Path ) -> HgSync :
656
+ def hg_repo (
657
+ remote_repos_path : pathlib .Path ,
658
+ projects_path : pathlib .Path ,
659
+ hg_remote_repo : pathlib .Path ,
660
+ ) -> HgSync :
657
661
"""Pre-made hg clone of remote repo checked out to user's projects dir."""
662
+ remote_repo_name = unique_repo_name (remote_repos_path = projects_path )
663
+ new_checkout_path = projects_path / remote_repo_name
664
+ master_copy = remote_repos_path / "hg_repo"
665
+
666
+ if master_copy .exists ():
667
+ shutil .copytree (master_copy , new_checkout_path )
668
+ return HgSync (
669
+ url = f"file://{ hg_remote_repo } " ,
670
+ path = str (new_checkout_path ),
671
+ )
672
+
658
673
hg_repo = HgSync (
659
674
url = f"file://{ hg_remote_repo } " ,
660
- path = str ( projects_path / "hg_repo" ) ,
675
+ path = master_copy ,
661
676
)
662
677
hg_repo .obtain ()
663
678
return hg_repo
You can’t perform that action at this time.
0 commit comments