D3002: stringutil: rename local email/names variables to their plural forms
sheehan (Connor Sheehan)
phabricator at mercurial-scm.org
Sun Apr 1 01:59:02 UTC 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG54b896f195d1: stringutil: rename local email/names variables to their plural forms (authored by sheehan, committed by ).
CHANGED PRIOR TO COMMIT
https://phab.mercurial-scm.org/D3002?vs=7478&id=7482#toc
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D3002?vs=7478&id=7482
REVISION DETAIL
https://phab.mercurial-scm.org/D3002
AFFECTED FILES
mercurial/utils/stringutil.py
CHANGE DETAILS
diff --git a/mercurial/utils/stringutil.py b/mercurial/utils/stringutil.py
--- a/mercurial/utils/stringutil.py
+++ b/mercurial/utils/stringutil.py
@@ -202,9 +202,9 @@
if line.lstrip().startswith('#') or any(c not in line for c in '<>@'):
continue
- # name, email hold the parsed emails and names for each line
+ # names, emails hold the parsed emails and names for each line
# name_builder holds the words in a persons name
- name, email = [], []
+ names, emails = [], []
namebuilder = []
for element in line.split():
@@ -215,29 +215,29 @@
elif element.startswith('<') and element.endswith('>'):
# We have found an email.
# Parse it, and finalize any names from earlier
- email.append(element[1:-1]) # Slice off the "<>"
+ emails.append(element[1:-1]) # Slice off the "<>"
if namebuilder:
- name.append(' '.join(namebuilder))
+ names.append(' '.join(namebuilder))
namebuilder = []
# Break if we have found a second email, any other
# data does not fit the spec for .mailmap
- if len(email) > 1:
+ if len(emails) > 1:
break
else:
# We have found another word in the committers name
namebuilder.append(element)
mailmapkey = mailmapping(
- email=email[-1],
- name=name[-1] if len(name) == 2 else None,
+ email=emails[-1],
+ name=names[-1] if len(names) == 2 else None,
)
mailmap[mailmapkey] = mailmapping(
- email=email[0],
- name=name[0] if name else None,
+ email=emails[0],
+ name=names[0] if names else None,
)
return mailmap
To: sheehan, #hg-reviewers, yuja
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list