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()