Skip to content

Commit

Permalink
Fixes #85
Browse files Browse the repository at this point in the history
HG returns the tags in the order they were created so we want the last one in the list
  • Loading branch information
mrussell42 authored Nov 6, 2023
1 parent a308a35 commit 97049e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bumpversion/scm.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def latest_tag_info(cls, tag_pattern: str) -> SCMInfo:
)
result.check_returncode()
if result.stdout:
current_version = result.stdout.splitlines(keepends=False)[0].lstrip("v")
current_version = result.stdout.splitlines(keepends=False)[-1].lstrip("v")
is_dirty = len(subprocess.check_output(["hg", "status", "-mard"])) != 0 # noqa: S603, S607
return SCMInfo(tool=cls, current_version=current_version, dirty=is_dirty)

Expand Down

0 comments on commit 97049e0

Please sign in to comment.