From 63f2f6808380e7ad6eeada3d795f0cc4f25c516f Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Wed, 12 Apr 2023 20:10:12 +0100 Subject: [PATCH] Backport PR #52138: DOC update contributors --- doc/sphinxext/announce.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/sphinxext/announce.py b/doc/sphinxext/announce.py index 1c45c03f36d64..89361eb75606c 100755 --- a/doc/sphinxext/announce.py +++ b/doc/sphinxext/announce.py @@ -39,6 +39,9 @@ from git import Repo +# Contributors to be renamed. +CONTRIBUTOR_MAPPING = {"znkjnffrezna": "znetbgcubravk"} + UTF8Writer = codecs.getwriter("utf8") this_repo = Repo(os.path.join(os.path.dirname(__file__), "..", "..")) @@ -87,6 +90,17 @@ def get_authors(revision_range): cur.discard("Homu") pre.discard("Homu") + # Rename contributors according to mapping. + for old_name, new_name in CONTRIBUTOR_MAPPING.items(): + old_name_decoded = codecs.decode(old_name, "rot13") + new_name_decoded = codecs.decode(new_name, "rot13") + if old_name_decoded in pre: + pre.discard(old_name_decoded) + pre.add(new_name_decoded) + if old_name_decoded in cur: + cur.discard(old_name_decoded) + cur.add(new_name_decoded) + # Append '+' to new authors. authors = [s + " +" for s in cur - pre] + list(cur & pre) authors.sort()