@@ -311,14 +311,14 @@ def choose_reviewer(self, repo, owner, diff, exclude):
311311 # no eligible reviewer found
312312 return None
313313
314- def get_to_mention (self , diff ):
314+ def get_to_mention (self , diff , author ):
315315 """
316316 Get the list of people to mention.
317317 """
318318 dirs = self .repo_config .get ('dirs' , {})
319319 mentions = self .repo_config .get ('mentions' , {})
320320
321- to_mention = []
321+ to_mention = set ()
322322 # If there's directories with specially assigned groups/users
323323 # inspect the diff to find the directory with the most additions
324324 if dirs :
@@ -340,15 +340,16 @@ def get_to_mention(self, diff):
340340 cur_dir = None
341341 if len (full_dir ) > 0 :
342342 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 )
348347
349348 mention_list = []
350349 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 )
352353 return mention_list
353354
354355 def add_labels (self , owner , repo , issue ):
@@ -379,7 +380,7 @@ def new_pr(self):
379380 reviewer = self .choose_reviewer (
380381 repo , owner , diff , author
381382 )
382- to_mention = self .get_to_mention (diff )
383+ to_mention = self .get_to_mention (diff , author )
383384
384385 self .set_assignee (
385386 reviewer , owner , repo , issue , self .integration_user ,
0 commit comments