Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _from_git(distribution):
option_dict = distribution.get_option_dict('pbr')
changelog = git._iter_log_oneline()
if changelog:
changelog = git._iter_changelog(changelog)
git.write_git_changelog(option_dict=option_dict, changelog=changelog)
git.generate_authors(option_dict=option_dict)
def _from_git(distribution):
option_dict = distribution.get_option_dict('pbr')
changelog = git._iter_log_oneline()
if changelog:
changelog = git._iter_changelog(changelog)
git.write_git_changelog(option_dict=option_dict, changelog=changelog)
git.generate_authors(option_dict=option_dict)
def _from_git(distribution):
option_dict = distribution.get_option_dict('pbr')
changelog = git._iter_log_oneline()
if changelog:
changelog = git._iter_changelog(changelog)
git.write_git_changelog(option_dict=option_dict, changelog=changelog)
git.generate_authors(option_dict=option_dict)
def _get_revno_and_last_tag(git_dir):
"""Return the commit data about the most recent tag.
We use git-describe to find this out, but if there are no
tags then we fall back to counting commits since the beginning
of time.
"""
changelog = git._iter_log_oneline(git_dir=git_dir)
row_count = 0
for row_count, (ignored, tag_set, ignored) in enumerate(changelog):
version_tags = set()
semver_to_tag = dict()
for tag in list(tag_set):
try:
semver = version.SemanticVersion.from_pip_string(tag)
semver_to_tag[semver] = tag
version_tags.add(semver)
except Exception:
pass
if version_tags:
return semver_to_tag[max(version_tags)], row_count
return "", row_count
def _get_revno_and_last_tag(git_dir):
"""Return the commit data about the most recent tag.
We use git-describe to find this out, but if there are no
tags then we fall back to counting commits since the beginning
of time.
"""
changelog = git._iter_log_oneline(git_dir=git_dir)
row_count = 0
for row_count, (ignored, tag_set, ignored) in enumerate(changelog):
version_tags = set()
semver_to_tag = dict()
for tag in list(tag_set):
try:
semver = version.SemanticVersion.from_pip_string(tag)
semver_to_tag[semver] = tag
version_tags.add(semver)
except Exception:
pass
if version_tags:
return semver_to_tag[max(version_tags)], row_count
return "", row_count
def _get_revno_and_last_tag(git_dir):
"""Return the commit data about the most recent tag.
We use git-describe to find this out, but if there are no
tags then we fall back to counting commits since the beginning
of time.
"""
changelog = git._iter_log_oneline(git_dir=git_dir)
row_count = 0
for row_count, (ignored, tag_set, ignored) in enumerate(changelog):
version_tags = set()
semver_to_tag = dict()
for tag in list(tag_set):
try:
semver = version.SemanticVersion.from_pip_string(tag)
semver_to_tag[semver] = tag
version_tags.add(semver)
except Exception:
pass
if version_tags:
return semver_to_tag[max(version_tags)], row_count
return "", row_count
def _get_revno_and_last_tag(git_dir):
"""Return the commit data about the most recent tag.
We use git-describe to find this out, but if there are no
tags then we fall back to counting commits since the beginning
of time.
"""
changelog = git._iter_log_oneline(git_dir=git_dir)
row_count = 0
for row_count, (ignored, tag_set, ignored) in enumerate(changelog):
version_tags = set()
semver_to_tag = dict()
for tag in list(tag_set):
try:
semver = version.SemanticVersion.from_pip_string(tag)
semver_to_tag[semver] = tag
version_tags.add(semver)
except Exception:
pass
if version_tags:
return semver_to_tag[max(version_tags)], row_count
return "", row_count