[asterisk-commits] mkrelease: Generate a full release summary on new point rele... (repotools[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 9 18:00:47 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: mkrelease: Generate a full release summary on new point releases
......................................................................


mkrelease: Generate a full release summary on new point releases

When a new full release is made (patch version is '0'), we currently
generate the release history based on the difference between that
version and the previous release candidate. For full releases, that
means the release summary ends up being empty - there generally aren't
any substantial changes between the last release candidate and the full
release made from that release candidate.

This patch alters the mkrelease script such that it will generate a full
release summary from the last known full previous release. Since the
ChangeLog, however, should still include the history of the release
candidates, it now builds a history summary for itself in this case.

Change-Id: I8352e557a772df5b4e00150d4eac4dedcd222f11
---
M mkrelease.py
1 file changed, 29 insertions(+), 1 deletion(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/mkrelease.py b/mkrelease.py
index b0e7f1d..462a158 100755
--- a/mkrelease.py
+++ b/mkrelease.py
@@ -233,6 +233,24 @@
         summary - The release summary object
         """
 
+        # Most times, the history of the ChangeLog will match the release
+        # summaries. However, on the first full release (patch version is 0),
+        # the release summaries are re-generated, while the ChangeLog should
+        # simply contain the history of the previous release candidates.
+        # Since the two are not the same in that case, we have to regenerate
+        # the history.
+        if version_object.patch == 0:
+            sum_opts = ReleaseSummaryOptions()
+            sum_opts.start_tag = start_version
+            sum_opts.end_tag = 'HEAD'
+            sum_opts.previous_version = prev_version
+            sum_opts.version = version
+            sum_opts.local_root = options.local_root
+            sum_opts.project = options.project
+            sum_opts.branch = branch
+
+            summary = ReleaseSummary(sum_opts, debug=debug)
+
         change_log_path = os.path.join(options.local_root, options.project,
                                        'ChangeLog')
         old_log_path = os.path.join(options.local_root, options.project,
@@ -249,6 +267,7 @@
         dprint("Copied '{0}' to '{1}'".format(change_log_path, old_log_path))
 
         # Switch back to our branch
+        dprint("Switching back to {0}".format(branch))
         repo.switch_local_branch(branch)
 
         # Actually create the new ChangeLog
@@ -299,12 +318,21 @@
             repo.repo.git.commit(message=msg)
 
         sum_opts = ReleaseSummaryOptions()
-        sum_opts.start_tag = start_version
+        # For release summaries, we re-build the full release summary
+        # if the release being generated is the first full release of a
+        # release cycle.
+        if version_object.patch != 0:
+            sum_opts.start_tag = start_version
+        else:
+            sum_opts.start_tag = prev_version
         sum_opts.end_tag = 'HEAD'
         sum_opts.previous_version = prev_version
         sum_opts.version = version
         sum_opts.local_root = options.local_root
         sum_opts.project = options.project
+        sum_opts.branch = branch
+        dprint("Creating release summary, starting from {0}".format(
+            sum_opts.start_tag))
 
         if len(options.advisories) != 0:
             sum_opts.release_type = ReleaseSummaryOptions.RELEASE_TYPE_SECURITY

-- 
To view, visit https://gerrit.asterisk.org/613
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8352e557a772df5b4e00150d4eac4dedcd222f11
Gerrit-PatchSet: 1
Gerrit-Project: repotools
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list