]> Git Repo - VerusCoin.git/commitdiff
Pull in temporary release notes during the release process
authorJack Grigg <[email protected]>
Thu, 22 Jun 2017 02:21:35 +0000 (14:21 +1200)
committerJack Grigg <[email protected]>
Thu, 29 Jun 2017 22:42:40 +0000 (15:42 -0700)
zcutil/release-notes.py

index 47f23490671e65c6c19bd79bba61acee42313c15..24adff0d09fa33883580986d0acc8ac9d09c39b4 100755 (executable)
@@ -4,6 +4,21 @@ import argparse
 from itertools import islice
 from operator import itemgetter
 
+TEMP_RELEASE_NOTES_HEADER = [
+    '(note: this is a temporary file, to be added-to by anybody, and moved to\n',
+    'release-notes at release time)\n',
+    '\n',
+    'Notable changes\n',
+    '===============\n',
+    '\n',
+]
+
+RELEASE_NOTES_CHANGELOG_HEADING = [
+    'Changelog\n',
+    '=========\n',
+    '\n',
+]
+
 author_aliases = {
     'Simon': 'Simon Liu',
     'bitcartel': 'Simon Liu',
@@ -77,9 +92,22 @@ def generate_release_note(version, filename):
     notes = subprocess.Popen(['git shortlog --no-merges {0}..HEAD'.format(latest_tag)], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE).communicate()[0]
     lines = notes.split('\n')
     lines = [alias_authors_in_release_notes(line) for line in lines]
+    temp_release_note = os.path.join(doc_dir, 'release-notes.md')
+    with open(temp_release_note, 'r') as f:
+        notable_changes = f.readlines()
+        # Assumes that all notable changes are appended to the default header
+        if len(notable_changes) > 6:
+            notable_changes = notable_changes[3:] + ['\n']
+        else:
+            notable_changes = []
     release_note = os.path.join(doc_dir, 'release-notes', 'release-notes-{0}.md'.format(version))
     with open(release_note, 'w') as f:
+        f.writelines(notable_changes)
+        f.writelines(RELEASE_NOTES_CHANGELOG_HEADING)
         f.writelines('\n'.join(lines))
+    # Clear temporary release notes file
+    with open(temp_release_note, 'w') as f:
+        f.writelines(TEMP_RELEASE_NOTES_HEADER)
 
 def main(version, filename):
     if version != None:
This page took 0.026468 seconds and 4 git commands to generate.