Skip to content

Commit a658c43

Browse files
committed
refactor!(pytest plugin[hg]) Consolidate repo creation function
1 parent 475b31a commit a658c43

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libvcs/pytest_plugin.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -506,17 +506,18 @@ def svn_remote_repo_with_files(
506506

507507

508508
def _create_hg_remote_repo(
509-
remote_repos_path: pathlib.Path,
510-
remote_repo_name: str,
509+
remote_repo_path: pathlib.Path,
511510
remote_repo_post_init: Optional[CreateRepoPostInitFn] = None,
512511
init_cmd_args: InitCmdArgs = None,
513512
) -> pathlib.Path:
514513
"""Create a test hg repo to for checkout / commit purposes."""
515514
if init_cmd_args is None:
516515
init_cmd_args = []
517516

518-
remote_repo_path = remote_repos_path / remote_repo_name
519-
run(["hg", "init", remote_repo_name, *init_cmd_args], cwd=remote_repos_path)
517+
run(
518+
["hg", "init", remote_repo_path.stem, *init_cmd_args],
519+
cwd=remote_repo_path.parent,
520+
)
520521

521522
if remote_repo_post_init is not None and callable(remote_repo_post_init):
522523
remote_repo_post_init(remote_repo_path=remote_repo_path)
@@ -548,8 +549,7 @@ def empty_hg_repo(
548549
return empty_hg_repo_path
549550

550551
return _create_hg_remote_repo(
551-
remote_repos_path=empty_hg_repo_path.parent,
552-
remote_repo_name=empty_hg_repo_path.stem,
552+
remote_repo_path=empty_hg_repo_path,
553553
remote_repo_post_init=None,
554554
init_cmd_args=None,
555555
)

0 commit comments

Comments
 (0)