Put the date in the heading of a pre release too.

This commit is contained in:
Wayne Davison
2020-06-21 19:46:28 -07:00
parent 7fb08531e0
commit 2564f25114
2 changed files with 3 additions and 4 deletions

View File

@@ -218,8 +218,8 @@ def get_NEWS_version_info():
with open('NEWS.md', 'r', encoding='utf-8') as fh:
for line in fh:
if not last_version:
m = re.search(r'rsync (\d+\.\d+\.\d+).*\d\d\d\d', line)
if not last_version: # Find the first non-dev|pre version with a release date.
m = re.search(r'rsync (\d+\.\d+\.\d+) .*\d\d\d\d', line)
if m:
last_version = m[1]
m = rel_re.match(line)

View File

@@ -190,8 +190,7 @@ About to:
elif fn == 'NEWS.md':
efv = re.escape(finalversion)
x_re = re.compile(r'^---+\n<.+>\s+# NEWS .+\s+Protocol: .+\n')
rel_day = 'UNRELEASED' if pre else today
repl = ('-'*78 + f'\n<a name="{version}"></a>\n\n# NEWS for rsync {version} ({rel_day})\n\n'
repl = ('-'*78 + f'\n<a name="{version}"></a>\n\n# NEWS for rsync {version} ({today})\n\n'
+ f"Protocol: {protocol_version} ({proto_changed})\n")
msg = f"The top lines of {fn} are not in the right format. They must be:\n" + repl
txt = replace_or_die(x_re, repl, txt, msg)