Skip to content

Commit

Permalink
exp push: Handle rev arg as list.
Browse files Browse the repository at this point in the history
  • Loading branch information
daavoo committed May 17, 2023
1 parent e6e3912 commit 1450179
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dvc/repo/experiments/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def exp_refs_from_names(scm: "Git", exp_names: List[str]) -> Set["ExpRefInfo"]:
return exp_ref_set


def exp_refs_from_rev(scm: "Git", rev: str, num: int = 1) -> Set["ExpRefInfo"]:
def exp_refs_from_rev(scm: "Git", rev: List[str], num: int = 1) -> Set["ExpRefInfo"]:
exp_ref_set = set()
rev_dict = iter_revs(scm, [rev], num)
rev_dict = iter_revs(scm, rev, num)
rev_set = set(rev_dict.keys())
ref_info_dict = exp_refs_by_baseline(scm, rev_set)
for _, ref_info_list in ref_info_dict.items():
Expand Down Expand Up @@ -112,6 +112,8 @@ def push(
if exp_names:
exp_ref_set.update(exp_refs_from_names(repo.scm, ensure_list(exp_names)))
if rev:
if isinstance(rev, str):
rev = [rev]
exp_ref_set.update(exp_refs_from_rev(repo.scm, rev, num=num))

push_result = _push(repo, git_remote, exp_ref_set, force)
Expand Down

0 comments on commit 1450179

Please sign in to comment.