Skip to content

Commit

Permalink
fix: handle unexpected hg repo when parse scm version (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan authored May 14, 2024
1 parent 9915cb6 commit d6feccf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pdm/backend/hooks/version/scm.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ def hg_parse_version(root: StrPath, config: Config) -> SCMVersion | None:
root,
)
tag: str | None
tag, node, branch = output.rsplit("-", 2)
try:
tag, node, branch = output.rsplit("-", 2)
except ValueError:
return None # unpacking failed, unexpected hg repo
# If no tag exists passes the tag filter.
if tag == "null":
tag = None
Expand Down

0 comments on commit d6feccf

Please sign in to comment.