@@ -311,14 +311,14 @@ def choose_reviewer(self, repo, owner, diff, exclude):
311
311
# no eligible reviewer found
312
312
return None
313
313
314
- def get_to_mention (self , diff ):
314
+ def get_to_mention (self , diff , author ):
315
315
"""
316
316
Get the list of people to mention.
317
317
"""
318
318
dirs = self .repo_config .get ('dirs' , {})
319
319
mentions = self .repo_config .get ('mentions' , {})
320
320
321
- to_mention = []
321
+ to_mention = set ()
322
322
# If there's directories with specially assigned groups/users
323
323
# inspect the diff to find the directory with the most additions
324
324
if dirs :
@@ -340,15 +340,16 @@ def get_to_mention(self, diff):
340
340
cur_dir = None
341
341
if len (full_dir ) > 0 :
342
342
for entry in mentions :
343
- if full_dir .startswith (entry ) and entry not in to_mention :
344
- to_mention .append (entry )
345
- elif (entry .endswith ('.rs' ) and full_dir .endswith (entry )
346
- and entry not in to_mention ):
347
- to_mention .append (entry )
343
+ if full_dir .startswith (entry ):
344
+ to_mention .add (entry )
345
+ elif entry .endswith ('.rs' ) and full_dir .endswith (entry ):
346
+ to_mention .add (entry )
348
347
349
348
mention_list = []
350
349
for mention in to_mention :
351
- mention_list .append (mentions [mention ])
350
+ entry = mentions [mention ]
351
+ if entry ["reviewers" ] != author :
352
+ mention_list .append (entry )
352
353
return mention_list
353
354
354
355
def add_labels (self , owner , repo , issue ):
@@ -379,7 +380,7 @@ def new_pr(self):
379
380
reviewer = self .choose_reviewer (
380
381
repo , owner , diff , author
381
382
)
382
- to_mention = self .get_to_mention (diff )
383
+ to_mention = self .get_to_mention (diff , author )
383
384
384
385
self .set_assignee (
385
386
reviewer , owner , repo , issue , self .integration_user ,
0 commit comments