default-reviewers: diff data should load more things lazy for better performance.
This commit is contained in:
parent
6c71e979b5
commit
d724630710
1 changed files with 5 additions and 1 deletions
|
|
@ -154,9 +154,10 @@ def get_diff_info(
|
|||
|
||||
commits = []
|
||||
if get_commit_authors:
|
||||
log.debug('Obtaining commit authors from set of commits')
|
||||
commits = target_scm.compare(
|
||||
target_ref, source_ref, source_scm, merge=True,
|
||||
pre_load=["author"])
|
||||
pre_load=["author", "date", "message", "branch", "parents"])
|
||||
|
||||
for commit in commits:
|
||||
user = User.get_from_cs_author(commit.author)
|
||||
|
|
@ -165,6 +166,7 @@ def get_diff_info(
|
|||
|
||||
# lines
|
||||
if get_authors:
|
||||
log.debug('Calculating authors of changed files')
|
||||
target_commit = source_repo.get_commit(ancestor_id)
|
||||
|
||||
for fname, lines in changed_lines.items():
|
||||
|
|
@ -190,6 +192,8 @@ def get_diff_info(
|
|||
author_counts[author] = author_counts.get(author, 0) + 1
|
||||
email_counts[email] = email_counts.get(email, 0) + 1
|
||||
|
||||
log.debug('Default reviewers processing finished')
|
||||
|
||||
return {
|
||||
'commits': commits,
|
||||
'files': all_files_changes,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue