def all_names(self) -> Set[str]:
retval = self.aliases.copy()
retval.add(self.identifier)
+ if self.email is not None:
+ retval.add(self.email)
return retval
def __eq__(self, other):
retval = self.people.copy()
for person in self.people.values():
- for alias in person.aliases:
- other_person = retval.get(alias)
- if other_person is not None:
- if alias in self.people:
+ for name in person.all_names:
+ other_person = retval.get(name)
+ if other_person is not None and other_person is not person:
+ alias_or_email = "alias"
+ if name == person.email:
+ alias_or_email = "email"
+ if name in self.people:
raise ConfigParseError(
- f"alias is not allowed to be the same as any"
- f" person's identifier: in person entry for "
- f"{person.identifier!r}: {alias!r} is also the "
+ f"{alias_or_email} is not allowed to be the same "
+ f"as any person's identifier: in person entry for "
+ f"{person.identifier!r}: {name!r} is also the "
f"identifier for person"
f" {other_person.identifier!r}")
raise ConfigParseError(
- f"alias is not allowed to be the same as another"
- f" person's alias: in person entry for "
- f"{person.identifier!r}: {alias!r} is also an alias "
- f"for person {other_person.identifier!r}")
- retval[alias] = person
+ f"{alias_or_email} is not allowed to be the same as "
+ f"another person's alias or email: in person entry "
+ f"for {person.identifier!r}: {name!r} is also an alias"
+ f" or email for person {other_person.identifier!r}")
+ retval[name] = person
return retval
@cached_property
aliases = ["a"]
output_markdown_file = "person2.mdwn"
""",
- "alias is not allowed to be the same as another person's alias: "
- "in person entry for 'person2': 'a' is also an alias for person "
- "'person1'")
+ "alias is not allowed to be the same as another person's alias or "
+ "email: in person entry for 'person2': 'a' is also an alias or "
+ "email for person 'person1'")
+ check_error(
+ """
+ bugzilla_url = ""
+ [milestones]
+ [people."person1"]
+ output_markdown_file = "person1.mdwn"
+ aliases = ["abc@example.com"]
+ [people."person2"]
+ email = "abc@example.com"
+ output_markdown_file = "person2.mdwn"
+ """,
+ "email is not allowed to be the same as another person's alias or "
+ "email: in person entry for 'person2': 'abc@example.com' is also "
+ "an alias or email for person 'person1'")
+ check_error(
+ """
+ bugzilla_url = ""
+ [milestones]
+ [people."person2"]
+ email = "abc@example.com"
+ output_markdown_file = "person2.mdwn"
+ [people."person1"]
+ output_markdown_file = "person1.mdwn"
+ aliases = ["abc@example.com"]
+ """,
+ "alias is not allowed to be the same as another person's alias or "
+ "email: in person entry for 'person1': 'abc@example.com' is also "
+ "an alias or email for person 'person2'")
check_error(
"""
bugzilla_url = ""