Skip to content

Commit 80c0ea4

Browse files
committed
chore: Use create_repo_legacy
1 parent 14650c8 commit 80c0ea4

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
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
28+
>>> from libvcs.shortcuts import create_repo_from_pip_url, create_repo_legacy
2929

3030
# repo is an object representation of a vcs repository.
31-
>>> r = create_repo(url='https://www.github.com/vcs-python/libtmux',
31+
>>> r = create_repo_legacy(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(
101+
>>> r = create_repo_legacy(
102102
... url='https://www.github.com/you/myrepo',
103103
... vcs='git',
104104
... repo_dir='/tmp/myrepo'

tests/test_base.py

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

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

77

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

1113
str_repo = str(repo)
1214
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, create_repo_from_pip_url
8+
from libvcs.shortcuts import create_repo_from_pip_url, create_repo_legacy
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(
91+
mercurial_repo = create_repo_legacy(
9292
url="--config=alias.clone=!touch ./HELLO", vcs="hg", repo_dir="./"
9393
)
9494
with pytest.raises(Exception):

tests/test_shortcuts.py

Lines changed: 6 additions & 4 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, create_repo_from_pip_url
7+
from libvcs.shortcuts import create_repo_from_pip_url, create_repo_legacy
88

99

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

7476
if raises_exception:
7577
with pytest.raises(raises_exception):
76-
create_repo(**repo_dict)
78+
create_repo_legacy(**repo_dict)
7779
else:
78-
repo = create_repo(**repo_dict)
80+
repo = create_repo_legacy(**repo_dict)
7981
assert isinstance(repo, repo_class)

0 commit comments

Comments
 (0)