Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if args.action == 'show':
changelog.show(as_json=args.json)
elif args.action == 'rewrite':
changelog.to_file(args.file)
elif args.action == 'extract':
for version in changelog.versions:
if version.name == args.version:
print version.get_release_notes()
break
else:
print >> sys.stderr, "ERROR: Couldn't find version '%s'." % (
args.version)
sys.exit(1)
elif args.action == 'add':
gitlab = GitlabRequest(url=args.gitlab_url, repo=args.repo,
token=args.token)
now = datetime.datetime.now()
version = Version(args.version,
int(now.day), MONTHS[now.month - 1], int(now.year))
last_version = None
since = None
if changelog.versions:
last_version = changelog.versions[0]
print >> sys.stderr, "INFO: Last version is '%s'." % (
last_version.name)
try:
last_tag = gitlab.get(
'repository/tags/%s' % last_version.name
)
except:
print >> sys.stderr, ("ERROR: Can't find previous release "
if args.action == 'show':
changelog.show(as_json=args.json)
elif args.action == 'rewrite':
changelog.to_file(args.file)
elif args.action == 'extract':
for version in changelog.versions:
if version.name == args.version:
print version.get_release_notes()
break
else:
print >> sys.stderr, "ERROR: Couldn't find version '%s'." % (
args.version)
sys.exit(1)
elif args.action == 'add':
gitlab = GitlabRequest(url=args.gitlab_url, repo=args.repo,
token=args.token)
now = datetime.datetime.now()
version = Version(args.version,
int(now.day), MONTHS[now.month - 1], int(now.year))
last_version = None
since = None
if changelog.versions:
last_version = changelog.versions[0]
print >> sys.stderr, "INFO: Last version is '%s'." % (
last_version.name)
try:
last_tag = gitlab.get(
'repository/tags/%s' % last_version.name
)
except:
print >> sys.stderr, ("ERROR: Can't find previous release "