##// END OF EJS Templates
pr-shadow: Adapt to new merge response object.
Martin Bornhold -
r1052:fd5a3923 default
parent child Browse files
Show More
@@ -450,7 +450,7 b' class PullRequestModel(BaseModel):'
450 return merge_state
450 return merge_state
451
451
452 def _comment_and_close_pr(self, pull_request, user, merge_state):
452 def _comment_and_close_pr(self, pull_request, user, merge_state):
453 pull_request.merge_rev = merge_state.merge_commit_id
453 pull_request.merge_rev = merge_state.merge_ref.commit_id
454 pull_request.updated_on = datetime.datetime.now()
454 pull_request.updated_on = datetime.datetime.now()
455
455
456 ChangesetCommentsModel().create(
456 ChangesetCommentsModel().create(
@@ -598,7 +598,7 b' class PullRequestModel(BaseModel):'
598 version._last_merge_source_rev = pull_request._last_merge_source_rev
598 version._last_merge_source_rev = pull_request._last_merge_source_rev
599 version._last_merge_target_rev = pull_request._last_merge_target_rev
599 version._last_merge_target_rev = pull_request._last_merge_target_rev
600 version._last_merge_status = pull_request._last_merge_status
600 version._last_merge_status = pull_request._last_merge_status
601 version.last_merge_rev = pull_request.last_merge_rev
601 version.shadow_merge_ref = pull_request.shadow_merge_ref
602 version.merge_rev = pull_request.merge_rev
602 version.merge_rev = pull_request.merge_rev
603
603
604 version.revisions = pull_request.revisions
604 version.revisions = pull_request.revisions
@@ -1010,7 +1010,7 b' class PullRequestModel(BaseModel):'
1010 pull_request.source_ref_parts.commit_id
1010 pull_request.source_ref_parts.commit_id
1011 pull_request._last_merge_target_rev = target_reference.commit_id
1011 pull_request._last_merge_target_rev = target_reference.commit_id
1012 pull_request._last_merge_status = merge_state.failure_reason
1012 pull_request._last_merge_status = merge_state.failure_reason
1013 pull_request.last_merge_rev = merge_state.merge_commit_id
1013 pull_request.shadow_merge_ref = merge_state.merge_ref
1014 Session().add(pull_request)
1014 Session().add(pull_request)
1015 Session().commit()
1015 Session().commit()
1016
1016
@@ -102,7 +102,7 b''
102 </div>
102 </div>
103
103
104 ## Link to the shadow repository.
104 ## Link to the shadow repository.
105 %if not c.pull_request.is_closed() and c.pull_request.last_merge_rev:
105 %if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref:
106 <div class="field">
106 <div class="field">
107 <div class="label-summary">
107 <div class="label-summary">
108 <label>Merge:</label>
108 <label>Merge:</label>
@@ -110,9 +110,9 b''
110 <div class="input">
110 <div class="input">
111 <div class="pr-mergeinfo">
111 <div class="pr-mergeinfo">
112 %if h.is_hg(c.pull_request.target_repo):
112 %if h.is_hg(c.pull_request.target_repo):
113 <input type="text" value="hg clone -u pr-merge ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly">
113 <input type="text" value="hg clone -u ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly">
114 %elif h.is_git(c.pull_request.target_repo):
114 %elif h.is_git(c.pull_request.target_repo):
115 <input type="text" value="git clone --branch pr-merge ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly">
115 <input type="text" value="git clone --branch ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly">
116 %endif
116 %endif
117 </div>
117 </div>
118 </div>
118 </div>
General Comments 0
You need to be logged in to leave comments. Login now