Skip to content

Commit

Permalink
Backport PR #52138 on branch 2.0.x (DOC update contributors) (#52631)
Browse files Browse the repository at this point in the history
Backport PR #52138: DOC update contributors

Co-authored-by: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com>
  • Loading branch information
meeseeksmachine and MarcoGorelli committed Apr 12, 2023
1 parent 5cdf5f3 commit 4567d6b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/sphinxext/announce.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__), "..", ".."))

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 4567d6b

Please sign in to comment.