# HG changeset patch # User Marcin Kuzminski # Date 2020-10-06 12:32:24 # Node ID 2365f5e77e4797f4af09ced7f850f6c3f40d819e # Parent fb547913a46dc4ca214b60d841e79a5fd66ad9b7 default-reviewers: diff data should load more things lazy for better performance. diff --git a/rhodecode/model/pull_request.py b/rhodecode/model/pull_request.py --- a/rhodecode/model/pull_request.py +++ b/rhodecode/model/pull_request.py @@ -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,