Skip to content
Open
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
5 changes: 5 additions & 0 deletions bumpversion/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ class VersionNotFoundException(BumpVersionException):

class InvalidVersionPartException(BumpVersionException):
"""The specified part (e.g. 'bugfix') was not found"""


class TaggingFailureException(BumpVersionException):
def __init__(self, message):
self.message = message
11 changes: 9 additions & 2 deletions bumpversion/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from bumpversion.exceptions import (
WorkingDirectoryIsDirtyException,
MercurialDoesNotSupportSignedTagsException,
TaggingFailureException,
)


Expand Down Expand Up @@ -135,7 +136,10 @@ def tag(cls, sign, name, message):
command += ["--sign"]
if message:
command += ["--message", message]
subprocess.check_output(command)
try:
subprocess.check_output(command, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
raise TaggingFailureException(f"{e.returncode} {e.output.decode()}")


class Mercurial(BaseVCS):
Expand Down Expand Up @@ -175,4 +179,7 @@ def tag(cls, sign, name, message):
)
if message:
command += ["--message", message]
subprocess.check_output(command)
try:
subprocess.check_output(command, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
raise TaggingFailureException(f"{e.returncode} {e.output.decode()}")