diff options
author | Dylan Baker <[email protected]> | 2019-10-28 08:47:14 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2020-03-05 15:14:56 -0800 |
commit | 5cdaa06221f73fcb9476c30f52e3210f1e3f65b7 (patch) | |
tree | 6ba16a75ac19856fc3b45d48d1aea30d3a8291f6 /bin | |
parent | e3d3abb1bcc67891094f03c924fcc7110848eed2 (diff) |
bin/post_version.py: Make the git commit as well.
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Juan A. Suarez <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2505>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/post_version.py | 8 | ||||
-rw-r--r-- | bin/post_version_test.py | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/bin/post_version.py b/bin/post_version.py index 3fbb5e2107c..5cf5f48615e 100755 --- a/bin/post_version.py +++ b/bin/post_version.py @@ -25,6 +25,8 @@ import argparse import calendar import datetime import pathlib +import subprocess + from lxml import ( etree, html, @@ -84,6 +86,7 @@ def update_index(is_point: bool, version: str, previous_version: str) -> None: root.insert(index, header) tree.write(p.as_posix(), method='html', pretty_print=True) + subprocess.run(['git', 'add', p]) def update_release_notes(previous_version: str) -> None: @@ -99,6 +102,7 @@ def update_release_notes(previous_version: str) -> None: ul.insert(0, li) tree.write(p.as_posix(), method='html', pretty_print=True) + subprocess.run(['git', 'add', p]) def update_calendar(previous_version: str) -> None: @@ -132,6 +136,7 @@ def update_calendar(previous_version: str) -> None: new.insert(0, td) tree.write(p.as_posix(), method='html', pretty_print=True) + subprocess.run(['git', 'add', p]) def main() -> None: @@ -145,6 +150,9 @@ def main() -> None: update_index(is_point, args.version, previous_version) update_release_notes(previous_version) update_calendar(previous_version) + subprocess.run(['git', 'commit', '-m', + 'docs: update calendar, add news item, and link releases ' + f'notes for {previous_version}']) if __name__ == "__main__": diff --git a/bin/post_version_test.py b/bin/post_version_test.py index 11b28061e57..d0794a609f4 100644 --- a/bin/post_version_test.py +++ b/bin/post_version_test.py @@ -27,6 +27,8 @@ import pytest from . import post_version +# Mock out subprocess.run to avoid having git commits [email protected]('bin.post_version.subprocess.run', mock.Mock()) class TestUpdateCalendar: HEAD = textwrap.dedent("""\ |