mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-30 07:18:27 +01:00
45 lines
1.1 KiB
Python
45 lines
1.1 KiB
Python
def imp(
|
|
self,
|
|
url,
|
|
path,
|
|
out=None,
|
|
rev=None,
|
|
config=None,
|
|
remote=None,
|
|
remote_config=None,
|
|
**kwargs,
|
|
):
|
|
erepo = {"url": url}
|
|
if rev is not None:
|
|
erepo["rev"] = rev
|
|
|
|
if remote and remote_config and isinstance(config, str):
|
|
raise ValueError(
|
|
"Can't specify config path together with both remote and remote_config"
|
|
)
|
|
|
|
if config is not None:
|
|
erepo["config"] = config
|
|
|
|
if remote is not None and remote_config is not None:
|
|
conf = erepo.get("config") or {}
|
|
|
|
core = conf.get("core") or {}
|
|
core["remote"] = remote
|
|
|
|
remotes = conf.get("remote") or {}
|
|
remote_conf = remotes.get(remote) or {}
|
|
remote_conf.update(remote_config)
|
|
remotes[remote] = remote_conf
|
|
|
|
conf["core"] = core
|
|
conf["remote"] = remotes
|
|
|
|
erepo["config"] = conf
|
|
elif remote is not None:
|
|
erepo["remote"] = remote
|
|
elif remote_config is not None:
|
|
erepo["remote"] = remote_config
|
|
|
|
return self.imp_url(path, out=out, erepo=erepo, frozen=True, **kwargs)
|