Skip to content

Commit 97049e0

Browse files
authored
Fixes #85
HG returns the tags in the order they were created so we want the last one in the list
1 parent a308a35 commit 97049e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bumpversion/scm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def latest_tag_info(cls, tag_pattern: str) -> SCMInfo:
310310
)
311311
result.check_returncode()
312312
if result.stdout:
313-
current_version = result.stdout.splitlines(keepends=False)[0].lstrip("v")
313+
current_version = result.stdout.splitlines(keepends=False)[-1].lstrip("v")
314314
is_dirty = len(subprocess.check_output(["hg", "status", "-mard"])) != 0 # noqa: S603, S607
315315
return SCMInfo(tool=cls, current_version=current_version, dirty=is_dirty)
316316

0 commit comments

Comments
 (0)