Changeset - 995d938ce14b
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2012-06-19 22:13:32
marcin@python-works.com
Fixed origin repo in pull-request view
3 files changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/compare.py
Show inline comments
 
@@ -69,24 +69,25 @@ class CompareController(BaseRepoControll
 
            raise HTTPNotFound
 

	
 
        if c.org_repo.scm_instance.alias != 'hg':
 
            log.error('Review not available for GIT REPOS')
 
            raise HTTPNotFound
 

	
 
        c.cs_ranges, discovery_data = PullRequestModel().get_compare_data(
 
                                       org_repo, org_ref, other_repo, other_ref
 
                                      )
 

	
 
        c.statuses = c.rhodecode_db_repo.statuses([x.raw_id for x in
 
                                                   c.cs_ranges])
 
        c.target_repo = c.repo_name
 
        # defines that we need hidden inputs with changesets
 
        c.as_form = request.GET.get('as_form', False)
 
        if request.environ.get('HTTP_X_PARTIAL_XHR'):
 
            return render('compare/compare_cs.html')
 

	
 
        c.org_ref = org_ref[1]
 
        c.other_ref = other_ref[1]
 
        # diff needs to have swapped org with other to generate proper diff
 
        _diff = diffs.differ(other_repo, other_ref, org_repo, org_ref,
 
                             discovery_data)
 
        diff_processor = diffs.DiffProcessor(_diff, format='gitdiff')
 
        _parsed = diff_processor.prepare()
rhodecode/controllers/pullrequests.py
Show inline comments
 
@@ -237,25 +237,25 @@ class PullrequestsController(BaseRepoCon
 
        for __, lines in c.inline_comments:
 
            for comments in lines.values():
 
                c.inline_cnt += len(comments)
 
        # comments
 
        c.comments = cc_model.get_comments(c.rhodecode_db_repo.repo_id,
 
                                           pull_request=pull_request_id)
 

	
 
        # changeset(pull-request) status
 
        c.current_changeset_status = cs_model.calculate_status(
 
                                        c.pull_request_reviewers
 
                                     )
 
        c.changeset_statuses = ChangesetStatus.STATUSES
 

	
 
        c.target_repo = c.pull_request.org_repo.repo_name
 
        return render('/pullrequests/pullrequest_show.html')
 

	
 
    @jsonify
 
    def comment(self, repo_name, pull_request_id):
 

	
 
        status = request.POST.get('changeset_status')
 
        change_status = request.POST.get('change_changeset_status')
 

	
 
        comm = ChangesetCommentsModel().create(
 
            text=request.POST.get('text'),
 
            repo_id=c.rhodecode_db_repo.repo_id,
 
            user_id=c.rhodecode_user.user_id,
rhodecode/templates/compare/compare_cs.html
Show inline comments
 
@@ -3,25 +3,25 @@
 
  <table class="compare_view_commits noborder">
 
  %if not c.cs_ranges:
 
    <tr><td>${_('No changesets')}</td></tr>
 
  %else:
 
    %for cnt, cs in enumerate(c.cs_ranges):
 
        <tr>
 
        <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),14)}"/></div></td>
 
        <td>
 
          %if cs.raw_id in c.statuses:
 
            <div title="${c.statuses[cs.raw_id][1]}" class="changeset-status-ico"><img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses[cs.raw_id][0])}" /></div>
 
          %endif
 
        </td>
 
        <td>${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
 
        <td>${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.target_repo,revision=cs.raw_id))}
 
        %if c.as_form:
 
          ${h.hidden('revisions',cs.raw_id)}
 
        %endif
 
        </td>
 
        <td><div class="author">${h.person(cs.author)}</div></td>
 
        <td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td>
 
        <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div></td>
 
        </tr>
 
    %endfor
 
  %endif
 
  </table>
 
</div>
0 comments (0 inline, 0 general)