Skip to content

Commit aaef28d

Browse files
authored
Merge pull request #14 from python/whatsnew-prev-version
Dynamicize previous version in whatsnew template.
2 parents 25abe2b + 5336687 commit aaef28d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

run_release.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
This saves the maintainer the effort of going through the Mercurial log
9393
when researching a change.
9494
95-
This article explains the new features in Python {version}, compared to 3.10.
95+
This article explains the new features in Python {version}, compared to {prev_version}.
9696
9797
For full details, see the :ref:`changelog <changelog>`.
9898
@@ -848,10 +848,12 @@ def maybe_prepare_new_master_branch(db: DbfilenameShelf) -> None:
848848
with cd(db["git_repo"]):
849849
release_mod.bump(new_release)
850850

851+
prev_branch = f"{release_tag.major}.{release_tag.minor}"
851852
new_branch = f"{release_tag.major}.{int(release_tag.minor)+1}"
852853
whatsnew_file = f"Doc/whatsnew/{new_branch}"
853854
with cd(db["git_repo"]), open(whatsnew_file, "w") as f:
854-
f.write(WHATS_NEW_TEMPLATE.format(version=new_branch))
855+
f.write(WHATS_NEW_TEMPLATE.format(version=new_branch,
856+
prev_version=prev_branch))
855857

856858
subprocess.check_call(
857859
["git", "add", whatsnew_file],

0 commit comments

Comments
 (0)