# HG changeset patch # User Marcin Kuzminski # Date 2019-12-06 11:08:12 # Node ID 1e7d835f81a110a27ced8960b7a49a52eea1ccc3 # Parent fe33631d427c6e848c9e6de4f56b81651c3d3b97 pull-requests: fixed source of changes to be using shadow repos if it exists. - previous logic was flaved as the OR condition always used the main repo - in case of GIT push -f and rebase we lost commits in the repo resulting in problems of displaying versions of pull-requests. diff --git a/rhodecode/apps/repository/views/repo_pull_requests.py b/rhodecode/apps/repository/views/repo_pull_requests.py --- a/rhodecode/apps/repository/views/repo_pull_requests.py +++ b/rhodecode/apps/repository/views/repo_pull_requests.py @@ -487,7 +487,9 @@ class RepoPullRequestsView(RepoAppView, log.debug('Failed to get shadow repo', exc_info=True) # try first the existing source_repo, and then shadow # repo if we can obtain one - commits_source_repo = source_scm or shadow_scm + commits_source_repo = source_scm + if shadow_scm: + commits_source_repo = shadow_scm c.commits_source_repo = commits_source_repo c.ancestor = None # set it to None, to hide it from PR view @@ -617,7 +619,7 @@ class RepoPullRequestsView(RepoAppView, diffset = cached_diff['diff'] else: diffset = self._get_range_diffset( - source_scm, source_repo, + commits_source_repo, source_repo, commit1, commit2, diff_limit, file_limit, c.fulldiff, ign_whitespace_lcl, context_lcl )