# HG changeset patch # User Martin Bornhold # Date 2016-09-20 16:08:40 # Node ID a4f1049ad9a010b7dd71c4a1e502a893be8bc768 # Parent e970000e18092b79f513c5117229799266564d85 pr: Display link to shadow repository on pull request page. diff --git a/rhodecode/controllers/pullrequests.py b/rhodecode/controllers/pullrequests.py --- a/rhodecode/controllers/pullrequests.py +++ b/rhodecode/controllers/pullrequests.py @@ -691,6 +691,8 @@ class PullrequestsController(BaseRepoCon c.pull_request, c.rhodecode_user) and not c.pull_request.is_closed() c.allowed_to_merge = PullRequestModel().check_user_merge( c.pull_request, c.rhodecode_user) and not c.pull_request.is_closed() + c.shadow_clone_url = PullRequestModel().get_shadow_clone_url( + c.pull_request) cc_model = ChangesetCommentsModel() 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 @@ -776,6 +776,9 @@ class PullRequestModel(BaseModel): pull_request_id=pull_request.pull_request_id, qualified=True) + def get_shadow_clone_url(self, pull_request): + return u'{url}/repository'.format(url=self.get_url(pull_request)) + def notify_reviewers(self, pull_request, reviewers_ids): # notification to reviewers if not reviewers_ids: diff --git a/rhodecode/templates/pullrequests/pullrequest_show.html b/rhodecode/templates/pullrequests/pullrequest_show.html --- a/rhodecode/templates/pullrequests/pullrequest_show.html +++ b/rhodecode/templates/pullrequests/pullrequest_show.html @@ -100,6 +100,25 @@ + + ## Clone link of the shadow repository. + %if not c.pull_request.is_closed(): +
+
+ +
+
+
+ %if h.is_hg(c.pull_request.target_repo): + + %elif h.is_git(c.pull_request.target_repo): + + %endif +
+
+
+ %endif +