mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
cli: config: rename --repo to --project (#5399)
Per https://github.com/iterative/dvc.org/pull/2064 Not changing the internal terminology because we stick to Repo in a lot of places there and adjusting all of it would be wasteful. Maybe in the future.
This commit is contained in:
@@ -173,11 +173,11 @@ level_group.add_argument(
|
||||
help="Use system config.",
|
||||
)
|
||||
level_group.add_argument(
|
||||
"--repo",
|
||||
"--project",
|
||||
dest="level",
|
||||
action="store_const",
|
||||
const="repo",
|
||||
help="Use repo config (.dvc/config).",
|
||||
help="Use project config (.dvc/config).",
|
||||
)
|
||||
level_group.add_argument(
|
||||
"--local",
|
||||
|
||||
@@ -258,5 +258,5 @@ def test_cache_dir_local(tmp_dir, dvc, caplog):
|
||||
assert path in caplog.text
|
||||
|
||||
caplog.clear()
|
||||
assert main(["cache", "dir", "--repo"]) == 251
|
||||
assert main(["cache", "dir", "--project"]) == 251
|
||||
assert "option 'dir' doesn't exist in section 'cache'" in caplog.text
|
||||
|
||||
@@ -85,13 +85,17 @@ def test_config_set_local(tmp_dir, dvc):
|
||||
(["remote.myremote.profile"], 0, "iterative"),
|
||||
(["remote.myremote.profile", "--local"], 0, "iterative"),
|
||||
(
|
||||
["remote.myremote.profile", "--repo"],
|
||||
["remote.myremote.profile", "--project"],
|
||||
251,
|
||||
"option 'profile' doesn't exist",
|
||||
),
|
||||
(["remote.other.url"], 0, "gs://bucket/path"),
|
||||
(["remote.other.url", "--local"], 0, "gs://bucket/path"),
|
||||
(["remote.other.url", "--repo"], 251, "remote 'other' doesn't exist"),
|
||||
(
|
||||
["remote.other.url", "--project"],
|
||||
251,
|
||||
"remote 'other' doesn't exist",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_config_get(tmp_dir, dvc, caplog, args, ret, msg):
|
||||
@@ -262,7 +266,8 @@ def test_config_show_origin_single(tmp_dir, dvc, caplog):
|
||||
|
||||
caplog.clear()
|
||||
assert (
|
||||
main(["config", "--show-origin", "--repo", "remote.myremote.url"]) == 0
|
||||
main(["config", "--show-origin", "--project", "remote.myremote.url"])
|
||||
== 0
|
||||
)
|
||||
assert (
|
||||
"{}\t{}\n".format(os.path.join(".dvc", "config"), "s3://bucket/path")
|
||||
@@ -276,7 +281,7 @@ def test_config_show_origin_single(tmp_dir, dvc, caplog):
|
||||
)
|
||||
|
||||
caplog.clear()
|
||||
assert main(["config", "--list", "--repo", "--show-origin"]) == 0
|
||||
assert main(["config", "--list", "--project", "--show-origin"]) == 0
|
||||
assert (
|
||||
"{}\t{}\n".format(
|
||||
os.path.join(".dvc", "config"),
|
||||
|
||||
Reference in New Issue
Block a user