mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-18 15:28:28 +01:00
add: deprecate --file
This commit is contained in:
committed by
Ruslan Kuprieiev
parent
26152292aa
commit
2c4365513e
@@ -16,7 +16,6 @@ class CmdAdd(CmdBase):
|
||||
self.repo.add(
|
||||
self.args.targets,
|
||||
no_commit=self.args.no_commit,
|
||||
file=self.args.file,
|
||||
external=self.args.external,
|
||||
glob=self.args.glob,
|
||||
out=self.args.out,
|
||||
@@ -62,11 +61,6 @@ def add_parser(subparsers, parent_parser):
|
||||
default=False,
|
||||
help="Allows targets containing shell-style wildcards.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--file",
|
||||
help="Specify name of the .dvc file this command will generate.",
|
||||
metavar="<filename>",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-o",
|
||||
"--out",
|
||||
|
||||
@@ -450,28 +450,6 @@ def test_add_force_overwrite_out(caplog, tmp_dir, dvc):
|
||||
assert (tmp_dir / "foo").read_text() == "foo"
|
||||
|
||||
|
||||
def test_add_filename(tmp_dir, dvc):
|
||||
tmp_dir.gen({"foo": "foo", "bar": "bar", "data": {"file": "file"}})
|
||||
ret = main(["add", "foo", "bar", "--file", "error.dvc"])
|
||||
assert ret != 0
|
||||
|
||||
ret = main(["add", "data", "--file", "data_directory.dvc"])
|
||||
assert ret == 0
|
||||
assert (tmp_dir / "data_directory.dvc").exists()
|
||||
|
||||
ret = main(["add", "foo", "--file", "bar.dvc"])
|
||||
assert ret == 0
|
||||
assert (tmp_dir / "bar.dvc").exists()
|
||||
assert not (tmp_dir / "foo.dvc").exists()
|
||||
|
||||
(tmp_dir / "bar.dvc").unlink()
|
||||
|
||||
ret = main(["add", "foo", "--file", "bar.dvc"])
|
||||
assert ret == 0
|
||||
assert (tmp_dir / "bar.dvc").exists()
|
||||
assert not (tmp_dir / "foo.dvc").exists()
|
||||
|
||||
|
||||
def test_failed_add_cleanup(tmp_dir, scm, dvc):
|
||||
tmp_dir.gen({"foo": "foo", "bar": "bar"})
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ def test_add(mocker, dvc):
|
||||
"--no-commit",
|
||||
"--external",
|
||||
"--glob",
|
||||
"--file",
|
||||
"file",
|
||||
"data",
|
||||
]
|
||||
)
|
||||
@@ -27,7 +25,6 @@ def test_add(mocker, dvc):
|
||||
["data"],
|
||||
no_commit=True,
|
||||
glob=True,
|
||||
file="file",
|
||||
external=True,
|
||||
out=None,
|
||||
remote=None,
|
||||
@@ -60,7 +57,6 @@ def test_add_to_remote(mocker):
|
||||
["s3://bucket/foo"],
|
||||
no_commit=False,
|
||||
glob=False,
|
||||
file=None,
|
||||
external=False,
|
||||
out="bar",
|
||||
remote="remote",
|
||||
|
||||
Reference in New Issue
Block a user