Changeset - abaf8e1033a6
[Not reviewed]
default
0 2 0
Thomas De Schampheleire - 8 years ago 2018-05-19 22:00:41
thomas.de_schampheleire@nokia.com
pullrequests: don't show empty "additional changesets" (issue #280)

When opening a pullrequest on a revision range including the tipmost
revision, and then pushing a new revision on top of that, the PR page shows:
This pullrequest can be updated with changes on ...:
and then nothing.

This is because the available revisions looped over are in 'avail_cs' but
the guard around the loop is checking on 'avail_revs'. The former, while
derived from avail_revs, can become empty under circumstances like this one.

Fix the problem by changing the guard checking avail_cs rather than
avail_revs, and making sure the printed message is aligned to 'No additional
changes found'.
2 files changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -541,8 +541,11 @@ class PullrequestsController(BaseRepoCon
 
                            hgrepo = org_scm_instance._repo
 
                        show = set(hgrepo.revs('::%ld & !::parents(%s) & !::%s',
 
                                               avail_revs, revs[0], targethead))
 
                        if show:
 
                        c.update_msg = _('The following additional changes are available on %s:') % c.cs_branch_name
 
                    else:
 
                            c.update_msg = _('No additional changesets found for iterating on this pull request.')
 
                    else:
 
                        show = set()
 
                        avail_revs = set() # drop revs[0]
 
                        c.update_msg = _('No additional changesets found for iterating on this pull request.')
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -136,7 +136,7 @@ ${self.repo_context_bar('showpullrequest
 
          <label>${_('Next iteration')}:</label>
 
            <div>
 
              <p>${c.update_msg}</p>
 
              %if c.avail_revs:
 
              %if c.avail_cs:
 
              <div id="updaterevs" class="clearfix">
 
                <div id="updaterevs-graph">
 
                  <canvas id="avail_graph_canvas"></canvas>
0 comments (0 inline, 0 general)