Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RM: remove url from GitRepo.__init__ -- was deprecated in 0.5.0 #5342

Merged
merged 2 commits into from Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions datalad/core/local/create.py
Expand Up @@ -380,7 +380,6 @@ def __call__(
lgr.info("Creating a new git repo at %s", tbds.path)
tbrepo = GitRepo(
tbds.path,
url=None,
create=True,
create_sanity_checks=False,
git_opts=initopts,
Expand All @@ -396,7 +395,6 @@ def __call__(
lgr.info("Creating a new annex repo at %s", tbds.path)
tbrepo = AnnexRepo(
tbds.path,
url=None,
create=True,
create_sanity_checks=False,
# do not set backend here, to avoid a dedicated commit
Expand Down
8 changes: 2 additions & 6 deletions datalad/support/annexrepo.py
Expand Up @@ -137,7 +137,7 @@ def _flyweight_invalid(self):
# reasons
_ALLOW_LOCAL_URLS = False

def __init__(self, path, url=None, runner=None,
def __init__(self, path, runner=None,
backend=None, always_commit=True,
create=True, create_sanity_checks=True,
init=False, batch_size=None, version=None, description=None,
Expand All @@ -154,10 +154,6 @@ def __init__(self, path, url=None, runner=None,
path: str
Path to git-annex repository. In case it's not an absolute path, it's
relative to PWD
url: str, optional
url to the to-be-cloned repository. Requires valid git url
according to
http://www.kernel.org/pub/software/scm/git/docs/git-clone.html#URLS .
runner: Runner, optional
Provide a Runner in case AnnexRepo shall not create it's own.
This is especially needed in case of desired dry runs.
Expand Down Expand Up @@ -193,7 +189,7 @@ def __init__(self, path, url=None, runner=None,
# scope.
do_init = False
super(AnnexRepo, self).__init__(
path, url, runner=runner,
path, runner=runner,
create=create, create_sanity_checks=create_sanity_checks,
repo=repo, git_opts=git_opts, fake_dates=fake_dates)

Expand Down
15 changes: 1 addition & 14 deletions datalad/support/gitrepo.py
Expand Up @@ -77,7 +77,6 @@
from .external_versions import external_versions
from .exceptions import (
CommandError,
DeprecatedError,
FileNotInRepositoryError,
GitIgnoreError,
InvalidGitReferenceError,
Expand Down Expand Up @@ -828,7 +827,7 @@ def _check_git_version(cls):
# override path since there is no need ATM for such details
path="datalad",
description="DataLad - Data management and distribution platform")
def __init__(self, path, url=None, runner=None, create=True,
def __init__(self, path, runner=None, create=True,
git_opts=None, repo=None, fake_dates=False,
create_sanity_checks=True,
**kwargs):
Expand All @@ -841,11 +840,6 @@ def __init__(self, path, url=None, runner=None, create=True,
path: str
path to the git repository; In case it's not an absolute path,
it's relative to PWD
url: str, optional
DEPRECATED -- use .clone() class method
url to the to-be-cloned repository. Requires a valid git url
according to:
http://www.kernel.org/pub/software/scm/git/docs/git-clone.html#URLS .
create: bool, optional
if true, creates a git repository at `path` if there is none. Also
creates `path`, if it doesn't exist.
Expand Down Expand Up @@ -920,13 +914,6 @@ def __init__(self, path, url=None, runner=None, create=True,
raise InvalidGitRepositoryError(path)
# END Repo validity test

if url is not None:
raise DeprecatedError(
new=".clone() class method",
version="0.5.0",
msg="RF: url passed to init()"
)

# So that we "share" control paths with git/git-annex
if ssh_manager:
ssh_manager.ensure_initialized()
Expand Down
3 changes: 0 additions & 3 deletions datalad/support/tests/test_gitrepo.py
Expand Up @@ -70,7 +70,6 @@
)
from datalad.support.exceptions import (
CommandError,
DeprecatedError,
FileNotInRepositoryError,
InvalidGitRepositoryError,
PathKnownToRepositoryError,
Expand Down Expand Up @@ -1241,8 +1240,6 @@ def _get_inodes(repo):
from datalad.support.network import get_local_file_url
clonepath = op.join(path, 'clone')
for src in (originpath, get_local_file_url(originpath, compatibility='git')):
# deprecated
assert_raises(DeprecatedError, GitRepo, url=src, path=clonepath)
clone = GitRepo.clone(url=src, path=clonepath, create=True)
clone_inodes = _get_inodes(clone)
eq_(origin_inodes, clone_inodes, msg='with src={}'.format(src))
Expand Down