Skip to content

Commit e28a762

Browse files
committed
Revert "chore: Use create_repo_legacy"
This reverts commit 80c0ea4.
1 parent 7038c66 commit e28a762

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ Create a [Repo](https://libvcs.git-pull.com/api.html#creating-a-repo-object) obj
2525
to inspect / checkout / update:
2626

2727
```python
28-
>>> from libvcs.shortcuts import create_repo_from_pip_url, create_repo_legacy
28+
>>> from libvcs.shortcuts import create_repo_from_pip_url, create_repo
2929

3030
# repo is an object representation of a vcs repository.
31-
>>> r = create_repo_legacy(url='https://www.github.com/vcs-python/libtmux',
31+
>>> r = create_repo(url='https://www.github.com/vcs-python/libtmux',
3232
... vcs='git',
3333
... repo_dir='/tmp/libtmux')
3434

libvcs/shortcuts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def create_repo_legacy(
9898
--------
9999
>>> from libvcs.shortcuts import create_repo_legacy
100100
>>>
101-
>>> r = create_repo_legacy(
101+
>>> r = create_repo(
102102
... url='https://www.github.com/you/myrepo',
103103
... vcs='git',
104104
... repo_dir='/tmp/myrepo'

tests/test_base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
import pathlib
33

44
from libvcs.base import BaseRepo, convert_pip_url
5-
from libvcs.shortcuts import create_repo_legacy
5+
from libvcs.shortcuts import create_repo
66

77

88
def test_repr():
9-
repo = create_repo_legacy(
10-
url="file://path/to/myrepo", repo_dir="/hello/", vcs="git"
11-
)
9+
repo = create_repo(url="file://path/to/myrepo", repo_dir="/hello/", vcs="git")
1210

1311
str_repo = str(repo)
1412
assert "GitRepo" in str_repo

tests/test_hg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77

8-
from libvcs.shortcuts import create_repo_from_pip_url, create_repo_legacy
8+
from libvcs.shortcuts import create_repo, create_repo_from_pip_url
99
from libvcs.util import run, which
1010

1111
if not which("hg"):
@@ -88,7 +88,7 @@ def test_vulnerability_2022_03_12_command_injection(
8888
random_dir = tmp_path / "random"
8989
random_dir.mkdir()
9090
monkeypatch.chdir(str(random_dir))
91-
mercurial_repo = create_repo_legacy(
91+
mercurial_repo = create_repo(
9292
url="--config=alias.clone=!touch ./HELLO", vcs="hg", repo_dir="./"
9393
)
9494
with pytest.raises(Exception):

tests/test_shortcuts.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from libvcs import GitRepo, MercurialRepo, SubversionRepo
66
from libvcs.exc import InvalidPipURL, InvalidVCS
7-
from libvcs.shortcuts import create_repo_from_pip_url, create_repo_legacy
7+
from libvcs.shortcuts import create_repo, create_repo_from_pip_url
88

99

1010
@pytest.mark.parametrize(
@@ -67,15 +67,13 @@ def test_create_repo_from_pip_url(
6767
),
6868
],
6969
)
70-
def test_create_repo_legacy(
71-
tmp_path: pathlib.Path, repo_dict, repo_class, raises_exception
72-
):
70+
def test_create_repo(tmp_path: pathlib.Path, repo_dict, repo_class, raises_exception):
7371
# add parent_dir via fixture
7472
repo_dict["repo_dir"] = tmp_path / "repo_name"
7573

7674
if raises_exception:
7775
with pytest.raises(raises_exception):
78-
create_repo_legacy(**repo_dict)
76+
create_repo(**repo_dict)
7977
else:
80-
repo = create_repo_legacy(**repo_dict)
78+
repo = create_repo(**repo_dict)
8179
assert isinstance(repo, repo_class)

0 commit comments

Comments
 (0)