exp branch: Make branch arg optional.

Default to `f"{ref_info.name}-branch"` where ref_info is inferred from the `exp_rev` argument.

Co-authored-by: Dave Berenbaum <[email protected]>
This commit is contained in:
David de la Iglesia Castro
2023-03-24 19:11:06 +01:00
co-authored by Dave Berenbaum
parent 5485275b92
commit e9fb0b92aa
4 changed files with 24 additions and 7 deletions
+2 -1
View File
@@ -246,11 +246,12 @@ def test_branch(tmp_dir, scm, dvc, exp_stage):
with pytest.raises(InvalidArgumentError):
dvc.experiments.branch("foo", "branch-exists")
dvc.experiments.branch("foo")
dvc.experiments.branch("foo", "branch-name")
dvc.experiments.branch(exp_a, "branch-rev")
dvc.experiments.branch(ref_a, "branch-ref")
for name in ["branch-name", "branch-rev", "branch-ref"]:
for name in ["foo-branch", "branch-name", "branch-rev", "branch-ref"]:
assert name in scm.list_branches()
assert scm.resolve_rev(name) == exp_a