##// END OF EJS Templates
Fixed status of changesets in preview windows...
marcink -
r2803:0b221460 beta
parent child Browse files
Show More
@@ -249,8 +249,7 b' class PullrequestsController(BaseRepoCon'
249 org_repo, org_ref, other_repo, other_ref
249 org_repo, org_ref, other_repo, other_ref
250 )
250 )
251
251
252 c.statuses = c.rhodecode_db_repo.statuses([x.raw_id for x in
252 c.statuses = org_repo.statuses([x.raw_id for x in c.cs_ranges])
253 c.cs_ranges])
254 # defines that we need hidden inputs with changesets
253 # defines that we need hidden inputs with changesets
255 c.as_form = request.GET.get('as_form', False)
254 c.as_form = request.GET.get('as_form', False)
256
255
@@ -277,6 +276,7 b' class PullrequestsController(BaseRepoCon'
277 c.users_array = repo_model.get_users_js()
276 c.users_array = repo_model.get_users_js()
278 c.users_groups_array = repo_model.get_users_groups_js()
277 c.users_groups_array = repo_model.get_users_groups_js()
279 c.pull_request = PullRequest.get_or_404(pull_request_id)
278 c.pull_request = PullRequest.get_or_404(pull_request_id)
279 c.target_repo = c.pull_request.org_repo.repo_name
280
280
281 cc_model = ChangesetCommentsModel()
281 cc_model = ChangesetCommentsModel()
282 cs_model = ChangesetStatusModel()
282 cs_model = ChangesetStatusModel()
@@ -322,12 +322,20 b' class PullrequestsController(BaseRepoCon'
322 c.comments = cc_model.get_comments(c.rhodecode_db_repo.repo_id,
322 c.comments = cc_model.get_comments(c.rhodecode_db_repo.repo_id,
323 pull_request=pull_request_id)
323 pull_request=pull_request_id)
324
324
325 # changeset(pull-request) status
325 try:
326 c.current_changeset_status = cs_model.calculate_status(
326 cur_status = c.statuses[c.pull_request.revisions[0]][0]
327 c.pull_request_reviewers
327 except:
328 )
328 log.error(traceback.format_exc())
329 cur_status = 'undefined'
330 if c.pull_request.is_closed() and 0:
331 c.current_changeset_status = cur_status
332 else:
333 # changeset(pull-request) status calulation based on reviewers
334 c.current_changeset_status = cs_model.calculate_status(
335 c.pull_request_reviewers,
336 )
329 c.changeset_statuses = ChangesetStatus.STATUSES
337 c.changeset_statuses = ChangesetStatus.STATUSES
330 c.target_repo = c.pull_request.org_repo.repo_name
338
331 return render('/pullrequests/pullrequest_show.html')
339 return render('/pullrequests/pullrequest_show.html')
332
340
333 @NotAnonymous()
341 @NotAnonymous()
@@ -64,7 +64,7 b' class ChangesetStatusModel(BaseModel):'
64
64
65 def calculate_status(self, statuses_by_reviewers):
65 def calculate_status(self, statuses_by_reviewers):
66 """
66 """
67 leading one wins, if number of occurences are equal than weaker wins
67 leading one wins, if number of occurrences are equal than weaker wins
68
68
69 :param statuses_by_reviewers:
69 :param statuses_by_reviewers:
70 """
70 """
@@ -20,7 +20,7 b''
20 ${self.breadcrumbs()}
20 ${self.breadcrumbs()}
21 </div>
21 </div>
22 %if c.pull_request.is_closed():
22 %if c.pull_request.is_closed():
23 <div style="padding:10px; font-size:22px;width:100%;text-align: center; color:#88D882">${_('Closed %s') % (h.age(c.pull_request.updated_on))}</div>
23 <div style="padding:10px; font-size:22px;width:100%;text-align: center; color:#88D882">${_('Closed %s') % (h.age(c.pull_request.updated_on))} ${_('with status %s') % h.changeset_status_lbl(c.current_changeset_status)}</div>
24 %endif
24 %endif
25 <h3>${_('Title')}: ${c.pull_request.title}</h3>
25 <h3>${_('Title')}: ${c.pull_request.title}</h3>
26
26
General Comments 0
You need to be logged in to leave comments. Login now