def update_reviewers(self, reviewers, add_owners_tbr=False, change=None):
    'Rewrites the R=/TBR= line(s) as a single line each.'
    assert isinstance(reviewers, list), reviewers
    if ((not reviewers) and (not add_owners_tbr)):
        return
    reviewers = reviewers[:]
    regexp = re.compile(self.R_LINE)
    matches = [regexp.match(line) for line in self._description_lines]
    new_desc = [l for (i, l) in enumerate(self._description_lines) if (not matches[i])]
    self.set_description(new_desc)
    r_names = []
    tbr_names = []
    for match in matches:
        if (not match):
            continue
        people = cleanup_list([match.group(2).strip()])
        if (match.group(1) == 'TBR'):
            tbr_names.extend(people)
        else:
            r_names.extend(people)
    for name in r_names:
        if (name not in reviewers):
            reviewers.append(name)
    if add_owners_tbr:
        owners_db = owners.Database(change.RepositoryRoot(), fopen=file, os_path=os.path, glob=glob.glob)
        all_reviewers = set((tbr_names + reviewers))
        missing_files = owners_db.files_not_covered_by(change.LocalPaths(), all_reviewers)
        tbr_names.extend(owners_db.reviewers_for(missing_files, change.author_email))
    new_r_line = (('R=' + ', '.join(reviewers)) if reviewers else None)
    new_tbr_line = (('TBR=' + ', '.join(tbr_names)) if tbr_names else None)
    line_loc = next((i for (i, match) in enumerate(matches) if match), (- 1))
    if (0 <= line_loc < len(self._description_lines)):
        if new_tbr_line:
            self._description_lines.insert(line_loc, new_tbr_line)
        if new_r_line:
            self._description_lines.insert(line_loc, new_r_line)
    else:
        if new_r_line:
            self.append_footer(new_r_line)
        if new_tbr_line:
            self.append_footer(new_tbr_line)
Rewrites the R=/TBR= line(s) as a single line each.
def update_reviewers(self, reviewers, add_owners_tbr=False, change=None):
    
    assert isinstance(reviewers, list), reviewers
    if ((not reviewers) and (not add_owners_tbr)):
        return
    reviewers = reviewers[:]
    regexp = re.compile(self.R_LINE)
    matches = [regexp.match(line) for line in self._description_lines]
    new_desc = [l for (i, l) in enumerate(self._description_lines) if (not matches[i])]
    self.set_description(new_desc)
    r_names = []
    tbr_names = []
    for match in matches:
        if (not match):
            continue
        people = cleanup_list([match.group(2).strip()])
        if (match.group(1) == 'TBR'):
            tbr_names.extend(people)
        else:
            r_names.extend(people)
    for name in r_names:
        if (name not in reviewers):
            reviewers.append(name)
    if add_owners_tbr:
        owners_db = owners.Database(change.RepositoryRoot(), fopen=file, os_path=os.path, glob=glob.glob)
        all_reviewers = set((tbr_names + reviewers))
        missing_files = owners_db.files_not_covered_by(change.LocalPaths(), all_reviewers)
        tbr_names.extend(owners_db.reviewers_for(missing_files, change.author_email))
    new_r_line = (('R=' + ', '.join(reviewers)) if reviewers else None)
    new_tbr_line = (('TBR=' + ', '.join(tbr_names)) if tbr_names else None)
    line_loc = next((i for (i, match) in enumerate(matches) if match), (- 1))
    if (0 <= line_loc < len(self._description_lines)):
        if new_tbr_line:
            self._description_lines.insert(line_loc, new_tbr_line)
        if new_r_line:
            self._description_lines.insert(line_loc, new_r_line)
    else:
        if new_r_line:
            self.append_footer(new_r_line)
        if new_tbr_line:
            self.append_footer(new_tbr_line)