Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version description for tagged releases #86

Merged
merged 1 commit into from
Mar 17, 2019
Merged
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
20 changes: 10 additions & 10 deletions tools/mumble-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,25 +101,25 @@ def main():
revListStr = cmd(['git', 'rev-list', '{0}..HEAD'.format(latestTag)])
revList = revListStr.split('\n')
nrevs = len(revList)-1 # Consider the newline at the end.
version = ''
if nrevs == 0:
# This might be a release version.
# Check to make sure!
# The most recent tag is the latest commit. That means this must
# be a tagged release version.
# We verify that the tag commit is the current HEAD to make sure it is.
revListStr = cmd(['git', 'rev-list', latestTag])
revList = revListStr.split('\n')
if len(revList) == 0:
raise Exception('unable to get rev-list for potential release tag')
latestCommitForLatestTag = revList[0]
if latestCommitForLatestTag != latestCommit:
raise Exception('commit-hash mismatch; aborting potential relase version string')
version = latestTag
else:
mumblePriVersion = readMumblePriVersion()
if len(mumblePriVersion) == 0 or not '.' in mumblePriVersion:
raise Exception('bad mumblePriVersion: "{0}"'.format(mumblePriVersion))

mumblePriVersion = readMumblePriVersion()
if len(mumblePriVersion) == 0 or not '.' in mumblePriVersion:
raise Exception('bad mumblePriVersion: "{0}"'.format(mumblePriVersion))

suffix = '~{0}~g{1}~snapshot'.format(nrevs, latestCommit[0:7])
version = mumblePriVersion
if nrevs > 0:
version += suffix
version = '{0}~{1}~g{2}~snapshot'.format(mumblePriVersion, nrevs, latestCommit[0:7])

end = ''
if '--newline' in sys.argv:
Expand Down