Skip to content

Commit

Permalink
Removed legacy names.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 5, 2023
1 parent 5fcc276 commit 07490e3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
7 changes: 1 addition & 6 deletions jaraco/vcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
from .subprocess import Mercurial, Git


__all__ = ['Repo', 'repo']
__all__ = ['Repo', 'repo', 'Mercurial', 'Git']

repo = Repo.detect

# for compatibility
RepoManager = Repo
MercurialManager = Mercurial
GitManager = Git
3 changes: 0 additions & 3 deletions jaraco/vcs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ def detect(location='.'):
e.args = ("No source repo or suitable VCS version found",)
raise

# for compatibility
get_first_valid_manager = detect

@staticmethod
def existing_only(managers):
"""
Expand Down
1 change: 1 addition & 0 deletions newsfragments/+22b83231.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed legacy names.
11 changes: 6 additions & 5 deletions tests/test_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
def test_existing_only():
"""
Test the static method RepoManager.existing_only.
Presumably, '/' is never an hg repo; at least for testing
purposes, that's a reasonable assumption.
"""
# presumably, '/' is never an hg repo - at least for our purposes, that's
# a reasonable assumption.
mgrs = vcs.Repo.get_valid_managers('/')
mgrs = vcs.Repo.detect('/')
existing = list(vcs.Repo.existing_only(mgrs))
assert not existing


@mock.patch.object(
vcs.Repo,
'get_valid_managers',
'detect',
classmethod(lambda cls, location: iter(())),
)
def test_no_valid_managers():
Expand All @@ -26,5 +27,5 @@ def test_no_valid_managers():
a nice message.
"""
with pytest.raises(StopIteration) as err:
vcs.Repo.get_first_valid_manager()
vcs.Repo.detect()
assert 'no source repo' in str(err).lower()

0 comments on commit 07490e3

Please sign in to comment.