Bring to the developer's attention that a version bump might be missing.

This commit is contained in:
Pedro Algarvio 2013-03-14 03:36:50 +00:00
parent cc38b94621
commit 52baa13a6d
2 changed files with 18 additions and 7 deletions

View file

@ -73,13 +73,24 @@ def __get_version(version, version_info):
parsed_version_info = tuple([
int(g) for g in match.groups()[:3] if g.isdigit()
])
if parsed_version_info != version_info:
if parsed_version_info > version_info:
warnings.warn(
'In order to get the proper salt version with the '
'git hash you need to update salt\'s local git '
'tags. Something like: \'git fetch --tags\' or '
'\'git fetch --tags upstream\' if you followed '
'salt\'s contribute documentation. The version '
'The parsed version info, `{0}`, is bigger than the one '
'defined in the file, `{1}`. Missing version bump?'.format(
parsed_version_info,
version_info
),
UserWarning,
stacklevel=2
)
return version, version_info
elif parsed_version_info < version_info:
warnings.warn(
'In order to get the proper salt version with the git hash '
'you need to update salt\'s local git tags. Something like: '
'\'git fetch --tags\' or \'git fetch --tags upstream\' if '
'you followed salt\'s contribute documentation. The version '
'string WILL NOT include the git hash.',
UserWarning,
stacklevel=2

View file

@ -115,7 +115,7 @@ class Clean(clean):
install_version_template = """\
# This file was auto-generated by salt's setup on \
{date:%A, %d %B %Y @ %H:%m:%S UTC}'.
{date:%A, %d %B %Y @ %H:%m:%S UTC}.
__version__ = {version!r}
__version_info__ = {version_info!r}