Changeset - f5e3e703b186
[Not reviewed]
default
0 3 0
Mads Kiilerich - 11 years ago 2014-08-01 20:28:42
madski@unity3d.com
pull requests: more helpful messages for PR update candidates and what is going on on the branch
3 files changed with 27 insertions and 10 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -223,18 +223,30 @@ class PullrequestsController(BaseRepoCon
 
            other_branch_name = c.other_ref_name
 
            if c.other_ref_type != 'branch':
 
                other_branch_name = other_scm_instance.get_changeset(c.other_ref_name).branch # use ref_type ?
 
            # candidates: descendants of old head that are on the right branch
 
            #             and not are the old head itself ...
 
            #             and nothing at all if old head is a descendent of target ref name
 
            if other_scm_instance._repo.revs('%s&::%s', revs[0], other_branch_name):
 
                pass
 
            if other_scm_instance._repo.revs('present(%s)::&%s', c.cs_ranges[-1].raw_id, other_branch_name):
 
                c.update_msg = _('This pull request has already been merged to %s.') % other_branch_name
 
            else: # look for children of PR head on source branch in org repo
 
                arevs = org_scm_instance._repo.revs('%s:: & branch(%s) - %s',
 
                                                    revs[0], c.org_branch_name, revs[0])
 
                c.available = [org_scm_instance.get_changeset(x) for x in arevs]
 
                if arevs:
 
                    if c.pull_request.is_closed():
 
                        c.update_msg = _('This pull request has been closed and can not be updated with descendent changes on %s:') % c.org_branch_name
 
                    else:
 
                        c.update_msg = _('This pull request can be updated with descendent changes on %s:') % c.org_branch_name
 
                    c.available = [org_scm_instance.get_changeset(x) for x in arevs]
 
                else:
 
                    c.update_msg = _('No changesets found for updating this pull request.')
 

	
 
            if org_scm_instance._repo.revs('head() & not (%s::) & branch(%s)', revs[0], c.org_branch_name):
 
                c.update_msg_other = _('Note: Branch %s also contains unrelated changes.') % c.org_branch_name
 
            else:
 
                c.update_msg_other = _('Branch %s does not contain other changes.') % c.org_branch_name
 

	
 
        raw_ids = [x.raw_id for x in c.cs_ranges]
 
        c.cs_comments = c.org_repo.get_comments(raw_ids)
 
        c.statuses = c.org_repo.statuses(raw_ids)
 

	
 
        ignore_whitespace = request.GET.get('ignorews') == '1'
kallithea/public/css/style.css
Show inline comments
 
@@ -4826,12 +4826,16 @@ span.pr-closed-tag {
 
#s2id_org_repo,
 
#s2id_other_repo {
 
    min-width: 150px;
 
    margin: 5px;
 
}
 

	
 
#pr-summary .msg-div {
 
    margin: 5px 0;
 
}
 

	
 
/****
 
  PERMS
 
*****/
 
#perms .perms_section_head {
 
    padding: 10px 10px 10px 0px;
 
    font-size: 16px;
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -174,32 +174,33 @@ ${self.repo_context_bar('showpullrequest
 

	
 
        ${h.form(url('pullrequest_copy_update',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id), method='post')}
 
          <div class="field">
 
            <div class="label-summary">
 
              <label>${_('Update')}:</label>
 
            </div>
 
            %if c.available:
 
              <div class="input" style="max-height:200px; overflow-y:auto; overflow-x:hidden">
 
                ${_("Changesets on %s not included in this pull request:") % c.org_branch_name}
 
            <div class="input">
 
              <div class="msg-div">${c.update_msg}</div>
 
              %if c.available:
 
              <div style="max-height:200px; overflow-y:auto; overflow-x:hidden; margin-bottom: 10px">
 
                <table class="noborder">
 
                  %for cnt, cs in enumerate(reversed(c.available)):
 
                    <tr>
 
                    <td>${h.radio(name='updaterev', value=cs.raw_id)}</td>
 
                    <td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.org_repo.repo_name,revision=cs.raw_id))}</td>
 
                    <td><div class="message" style="white-space:normal; height:1.1em; max-width: 500px; padding:0">${h.urlify_commit(cs.message, c.repo_name)}</div></td>
 
                    </tr>
 
                  %endfor
 
                </table>
 
              </div>
 
              %endif
 
              <div class="msg-div">${c.update_msg_other}</div>
 
            </div>
 
            %if c.available:
 
              <div class="buttons">
 
                ${h.submit('copy_update',_('Create pull request update'),class_="btn btn-small")}
 
              </div>
 
            %else:
 
              <div class="input">
 
                ${_("No changesets found for updating this pull request.")}
 
              </div>
 
            %endif
 
          </div>
 
        ${h.end_form()}
 

	
 
      </div>
 
    </div>
0 comments (0 inline, 0 general)