##// END OF EJS Templates
pull-requests: show common ancestor inside pull-request view....
marcink -
r1594:d24b008b default
parent child Browse files
Show More
@@ -684,7 +684,6 b' class PullrequestsController(BaseRepoCon'
684 c.shadow_clone_url = PullRequestModel().get_shadow_clone_url(
684 c.shadow_clone_url = PullRequestModel().get_shadow_clone_url(
685 pull_request_at_ver)
685 pull_request_at_ver)
686
686
687 c.ancestor = None # empty ancestor hidden in display
688 c.pull_request = pull_request_display_obj
687 c.pull_request = pull_request_display_obj
689 c.pull_request_latest = pull_request_latest
688 c.pull_request_latest = pull_request_latest
690
689
@@ -801,12 +800,15 b' class PullrequestsController(BaseRepoCon'
801 target_commit = EmptyCommit()
800 target_commit = EmptyCommit()
802 c.missing_requirements = False
801 c.missing_requirements = False
803
802
803 source_scm = source_repo.scm_instance()
804 target_scm = target_repo.scm_instance()
805
804 # try first shadow repo, fallback to regular repo
806 # try first shadow repo, fallback to regular repo
805 try:
807 try:
806 commits_source_repo = pull_request_latest.get_shadow_repo()
808 commits_source_repo = pull_request_latest.get_shadow_repo()
807 except Exception:
809 except Exception:
808 log.debug('Failed to get shadow repo', exc_info=True)
810 log.debug('Failed to get shadow repo', exc_info=True)
809 commits_source_repo = source_repo.scm_instance()
811 commits_source_repo = source_scm
810
812
811 c.commits_source_repo = commits_source_repo
813 c.commits_source_repo = commits_source_repo
812 commit_cache = {}
814 commit_cache = {}
@@ -830,6 +832,15 b' class PullrequestsController(BaseRepoCon'
830 'Failed to get all required data from repo', exc_info=True)
832 'Failed to get all required data from repo', exc_info=True)
831 c.missing_requirements = True
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 c.statuses = source_repo.statuses(
844 c.statuses = source_repo.statuses(
834 [x.raw_id for x in c.commit_ranges])
845 [x.raw_id for x in c.commit_ranges])
835
846
@@ -83,6 +83,11 b''
83 <span class="clone-url">
83 <span class="clone-url">
84 <a href="${h.url('summary_home', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a>
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 </span>
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 </div>
91 </div>
87 <div class="pr-pullinfo">
92 <div class="pr-pullinfo">
88 %if h.is_hg(c.pull_request.source_repo):
93 %if h.is_hg(c.pull_request.source_repo):
General Comments 0
You need to be logged in to leave comments. Login now