|
Lines 462-467
class CommitterList(object):
Tools/Scripts/webkitpy/common/config/committers.py_sec1
|
| 462 |
self._contributors = contributors + committers + reviewers |
462 |
self._contributors = contributors + committers + reviewers |
| 463 |
self._committers = committers + reviewers |
463 |
self._committers = committers + reviewers |
| 464 |
self._reviewers = reviewers |
464 |
self._reviewers = reviewers |
|
|
465 |
self._contributors_by_name = {} |
| 465 |
self._accounts_by_email = {} |
466 |
self._accounts_by_email = {} |
| 466 |
self._accounts_by_login = {} |
467 |
self._accounts_by_login = {} |
| 467 |
|
468 |
|
|
Lines 477-482
class CommitterList(object):
Tools/Scripts/webkitpy/common/config/committers.py_sec2
|
| 477 |
def reviewers(self): |
478 |
def reviewers(self): |
| 478 |
return self._reviewers |
479 |
return self._reviewers |
| 479 |
|
480 |
|
|
|
481 |
def _name_to_contributor_map(self): |
| 482 |
if not len(self._contributors_by_name): |
| 483 |
for contributor in self._contributors: |
| 484 |
assert(contributor.full_name) |
| 485 |
assert(contributor.full_name.lower() not in self._contributors_by_name) # We should never have duplicate names. |
| 486 |
self._contributors_by_name[contributor.full_name.lower()] = contributor |
| 487 |
return self._contributors_by_name |
| 488 |
|
| 480 |
def _email_to_account_map(self): |
489 |
def _email_to_account_map(self): |
| 481 |
if not len(self._accounts_by_email): |
490 |
if not len(self._accounts_by_email): |
| 482 |
for account in self._accounts: |
491 |
for account in self._accounts: |
|
Lines 509-521
class CommitterList(object):
Tools/Scripts/webkitpy/common/config/committers.py_sec3
|
| 509 |
return None |
518 |
return None |
| 510 |
return record |
519 |
return record |
| 511 |
|
520 |
|
| 512 |
def contributor_by_name(self, name): |
|
|
| 513 |
# This could be made into a hash lookup if callers need it to be fast. |
| 514 |
for contributor in self.contributors(): |
| 515 |
if contributor.full_name and contributor.full_name == name: |
| 516 |
return contributor |
| 517 |
return None |
| 518 |
|
| 519 |
def committer_by_name(self, name): |
521 |
def committer_by_name(self, name): |
| 520 |
return self._committer_only(self.contributor_by_name(name)) |
522 |
return self._committer_only(self.contributor_by_name(name)) |
| 521 |
|
523 |
|
|
Lines 540-546
class CommitterList(object):
Tools/Scripts/webkitpy/common/config/committers.py_sec4
|
| 540 |
string = string.lower() |
542 |
string = string.lower() |
| 541 |
|
543 |
|
| 542 |
# First path, optimitically match for fullname, email and irc_nicknames |
544 |
# First path, optimitically match for fullname, email and irc_nicknames |
| 543 |
account = self.account_by_email(string) or self.contributor_by_irc_nickname(string) or self.contributor_by_name(string) |
545 |
account = self.contributor_by_name(string) or self.account_by_email(string) or self.contributor_by_irc_nickname(string) |
| 544 |
if account: |
546 |
if account: |
| 545 |
return [account], 0 |
547 |
return [account], 0 |
| 546 |
|
548 |
|
|
Lines 568-573
class CommitterList(object):
Tools/Scripts/webkitpy/common/config/committers.py_sec5
|
| 568 |
def account_by_email(self, email): |
570 |
def account_by_email(self, email): |
| 569 |
return self._email_to_account_map().get(email.lower()) |
571 |
return self._email_to_account_map().get(email.lower()) |
| 570 |
|
572 |
|
|
|
573 |
def contributor_by_name(self, name): |
| 574 |
return self._name_to_contributor_map().get(name.lower()) |
| 575 |
|
| 571 |
def contributor_by_email(self, email): |
576 |
def contributor_by_email(self, email): |
| 572 |
return self._contributor_only(self.account_by_email(email)) |
577 |
return self._contributor_only(self.account_by_email(email)) |
| 573 |
|
578 |
|