From 1450179b0f62d254c939a39a5219c91a5fd04e1e Mon Sep 17 00:00:00 2001 From: daavoo Date: Wed, 17 May 2023 22:12:49 +0200 Subject: [PATCH] exp push: Handle rev arg as list. --- dvc/repo/experiments/push.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dvc/repo/experiments/push.py b/dvc/repo/experiments/push.py index 7e0913a68da..d5547d2e0df 100644 --- a/dvc/repo/experiments/push.py +++ b/dvc/repo/experiments/push.py @@ -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(): @@ -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)