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 25 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -226,12 +226,24 @@ class PullrequestsController(BaseRepoCon
 
            # 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])
 
                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)
kallithea/public/css/style.css
Show inline comments
 
@@ -4829,6 +4829,10 @@ span.pr-closed-tag {
 
    margin: 5px;
 
}
 

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

	
 
/****
 
  PERMS
 
*****/
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -177,9 +177,10 @@ ${self.repo_context_bar('showpullrequest
 
            <div class="label-summary">
 
              <label>${_('Update')}:</label>
 
            </div>
 
            <div class="input">
 
              <div class="msg-div">${c.update_msg}</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 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>
 
@@ -190,13 +191,13 @@ ${self.repo_context_bar('showpullrequest
 
                  %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()}
0 comments (0 inline, 0 general)