Revert "Get the pending version from the commit message"

This reverts commit 16acd669a7.
This commit is contained in:
Cheng Zhao 2015-07-03 21:21:19 +08:00
parent 26525d6b0f
commit a1b28c362d

View file

@ -59,7 +59,8 @@ def main():
tag_exists = True
break
release = create_or_get_release_draft(github, releases, tag_exists)
release = create_or_get_release_draft(github, releases, args.version,
tag_exists)
if args.publish_release:
# Upload the SHASUMS.txt.
@ -154,25 +155,20 @@ def get_text_with_editor(name):
os.unlink(t.name)
return text
def create_or_get_release_draft(github, releases, tag_exists):
def create_or_get_release_draft(github, releases, tag, tag_exists):
# Search for existing draft.
for release in releases:
if release['draft']:
return release
if tag_exists:
version = 'do-not-publish-me'
else:
version = get_bumped_version()
return create_release_draft(github, version)
tag = 'do-not-publish-me'
return create_release_draft(github, tag)
def create_release_draft(github, tag):
if os.environ.has_key('CI'):
if tag == 'do-not-publish-me':
name = '{0} pending draft'.format(PROJECT_NAME)
else:
name = '{0} {1}'.format(PROJECT_NAME, tag)
name = '{0} pending draft'.format(PROJECT_NAME)
body = '(placeholder)'
else:
name = '{0} {1}'.format(PROJECT_NAME, tag)
@ -218,14 +214,6 @@ def auth_token():
return token
def get_bumped_version():
message = execute(['git', 'log', '--format=%B', '-n', '1', 'HEAD']).strip()
if message.startswith('Bump '):
return message[5:]
else:
return ATOM_SHELL_VERSION
if __name__ == '__main__':
import sys
sys.exit(main())