Merge "handle first releases better in the release notes"

This commit is contained in:
Jenkins 2016-02-24 17:03:20 +00:00 committed by Gerrit Code Review
commit cc4b6ff200
3 changed files with 22 additions and 0 deletions

View File

@ -67,6 +67,12 @@ fi
# fails because there are no other tags, we will produce the entire # fails because there are no other tags, we will produce the entire
# history. # history.
PREVIOUS_VERSION=$(git describe --abbrev=0 ${VERSION}^ || echo "") PREVIOUS_VERSION=$(git describe --abbrev=0 ${VERSION}^ || echo "")
if [[ "$PREVIOUS_VERSION" = "" ]]; then
# There was no previous tag, so we're looking for the full history
# of the project.
PREVIOUS_VERSION=$(git rev-list --max-parents=0 HEAD)
first_release="--first-release"
fi
# Extract the tag message by parsing the git show output, which looks # Extract the tag message by parsing the git show output, which looks
# something like: # something like:
@ -135,6 +141,7 @@ release-notes \
$email_tags \ $email_tags \
--series $SERIES \ --series $SERIES \
$stable \ $stable \
$first_release \
. "$PREVIOUS_VERSION" "$VERSION" \ . "$PREVIOUS_VERSION" "$VERSION" \
$include_pypi_link \ $include_pypi_link \
| tee $relnotes_file | tee $relnotes_file

View File

@ -45,6 +45,11 @@ def main():
default=False, default=False,
help='include a pypi hyperlink for the library', help='include a pypi hyperlink for the library',
) )
parser.add_argument('--first-release',
action='store_true',
default=False,
help='this is the first release of the project',
)
parser.add_argument("--skip-requirement-merges", parser.add_argument("--skip-requirement-merges",
action='store_true', default=False, action='store_true', default=False,
help="skip requirement update commit messages" help="skip requirement update commit messages"
@ -108,6 +113,7 @@ def main():
email_tags=args.email_tags, email_tags=args.email_tags,
include_pypi_link=args.include_pypi_link, include_pypi_link=args.include_pypi_link,
changes_only=args.changes_only, changes_only=args.changes_only,
first_release=args.first_release,
) )
print(notes.encode('utf-8')) print(notes.encode('utf-8'))
return 0 return 0

View File

@ -73,6 +73,9 @@ We are {{ emotion }} to announce the release of:
{{ project }} {{ end_rev }}: {{ description }} {{ project }} {{ end_rev }}: {{ description }}
{% if first_release -%}
This is the first release of {{project}}.
{%- endif %}
{% if series -%} {% if series -%}
This release is part of the {{series}} {% if stable_series %}stable {% endif %}release series. This release is part of the {{series}} {% if stable_series %}stable {% endif %}release series.
{%- endif %} {%- endif %}
@ -108,6 +111,7 @@ NOTE: Skipping requirement commits...
{% for change in changes -%} {% for change in changes -%}
{{ change }} {{ change }}
{% endfor %} {% endfor %}
{% if not first_release -%}
Diffstat (except docs and test files) Diffstat (except docs and test files)
------------------------------------- -------------------------------------
@ -121,6 +125,7 @@ Requirements updates
{% for change in requirement_changes -%} {% for change in requirement_changes -%}
{{ change }} {{ change }}
{% endfor %} {% endfor %}
{%- endif %}
{% endif %} {% endif %}
""" """
@ -189,6 +194,7 @@ def generate_release_notes(library, library_path,
email_to, email_reply_to, email_tags, email_to, email_reply_to, email_tags,
include_pypi_link, include_pypi_link,
changes_only, changes_only,
first_release,
): ):
"""Return the text of the release notes. """Return the text of the release notes.
@ -214,6 +220,8 @@ def generate_release_notes(library, library_path,
page. page.
:param changes_only: Boolean indicating whether to limit output to :param changes_only: Boolean indicating whether to limit output to
the list of changes, without any extra data. the list of changes, without any extra data.
:param first_release: Boolean indicating whether this is the first
release of the project
""" """
@ -321,6 +329,7 @@ def generate_release_notes(library, library_path,
'email_reply_to': email_reply_to, 'email_reply_to': email_reply_to,
'email_tags': email_tags, 'email_tags': email_tags,
'reno_notes': reno_notes, 'reno_notes': reno_notes,
'first_release': first_release,
}) })
if include_pypi_link: if include_pypi_link:
params['pypi_url'] = PYPI_URL_TPL % library_name params['pypi_url'] = PYPI_URL_TPL % library_name