Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions dvc/repo/experiments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ExperimentExistsError,
ExpRefInfo,
ExpStashEntry,
InvalidExpRefError,
MultipleBranchError,
)
from .executor.base import (
Expand Down Expand Up @@ -724,9 +725,12 @@ def get_exact_name(self, rev: str):
exclude = f"{EXEC_NAMESPACE}/*"
ref = self.scm.describe(rev, base=EXPS_NAMESPACE, exclude=exclude)
if ref:
name = ExpRefInfo.from_ref(ref).name
if name:
return name
try:
name = ExpRefInfo.from_ref(ref).name
if name:
return name
except InvalidExpRefError:
pass
if rev in self.stash_revs:
return self.stash_revs[rev].name
return None
Expand Down
2 changes: 1 addition & 1 deletion dvc/repo/experiments/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def from_ref(cls, ref: str):
or len(parts) > 5
or "/".join(parts[:2]) != EXPS_NAMESPACE
):
InvalidExpRefError(ref)
raise InvalidExpRefError(ref)
except ValueError:
raise InvalidExpRefError(ref)
baseline_sha = parts[2] + parts[3] if len(parts) >= 4 else None
Expand Down