Show More
@@ -684,7 +684,6 b' class PullrequestsController(BaseRepoCon' | |||
|
684 | 684 | c.shadow_clone_url = PullRequestModel().get_shadow_clone_url( |
|
685 | 685 | pull_request_at_ver) |
|
686 | 686 | |
|
687 | c.ancestor = None # empty ancestor hidden in display | |
|
688 | 687 | c.pull_request = pull_request_display_obj |
|
689 | 688 | c.pull_request_latest = pull_request_latest |
|
690 | 689 | |
@@ -801,12 +800,15 b' class PullrequestsController(BaseRepoCon' | |||
|
801 | 800 | target_commit = EmptyCommit() |
|
802 | 801 | c.missing_requirements = False |
|
803 | 802 | |
|
803 | source_scm = source_repo.scm_instance() | |
|
804 | target_scm = target_repo.scm_instance() | |
|
805 | ||
|
804 | 806 | # try first shadow repo, fallback to regular repo |
|
805 | 807 | try: |
|
806 | 808 | commits_source_repo = pull_request_latest.get_shadow_repo() |
|
807 | 809 | except Exception: |
|
808 | 810 | log.debug('Failed to get shadow repo', exc_info=True) |
|
809 |
commits_source_repo = source_ |
|
|
811 | commits_source_repo = source_scm | |
|
810 | 812 | |
|
811 | 813 | c.commits_source_repo = commits_source_repo |
|
812 | 814 | commit_cache = {} |
@@ -830,6 +832,15 b' class PullrequestsController(BaseRepoCon' | |||
|
830 | 832 | 'Failed to get all required data from repo', exc_info=True) |
|
831 | 833 | c.missing_requirements = True |
|
832 | 834 | |
|
835 | c.ancestor = None # set it to None, to hide it from PR view | |
|
836 | ||
|
837 | try: | |
|
838 | ancestor_id = source_scm.get_common_ancestor( | |
|
839 | source_commit.raw_id, target_commit.raw_id, target_scm) | |
|
840 | c.ancestor_commit = source_scm.get_commit(ancestor_id) | |
|
841 | except Exception: | |
|
842 | c.ancestor_commit = None | |
|
843 | ||
|
833 | 844 | c.statuses = source_repo.statuses( |
|
834 | 845 | [x.raw_id for x in c.commit_ranges]) |
|
835 | 846 |
@@ -83,6 +83,11 b'' | |||
|
83 | 83 | <span class="clone-url"> |
|
84 | 84 | <a href="${h.url('summary_home', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a> |
|
85 | 85 | </span> |
|
86 | <br/> | |
|
87 | % if c.ancestor_commit: | |
|
88 | ${_('Common ancestor')}: | |
|
89 | <code><a href="${h.url('changeset_home', repo_name=c.target_repo.repo_name, revision=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a></code> | |
|
90 | % endif | |
|
86 | 91 | </div> |
|
87 | 92 | <div class="pr-pullinfo"> |
|
88 | 93 | %if h.is_hg(c.pull_request.source_repo): |
General Comments 0
You need to be logged in to leave comments.
Login now