Changeset - 7879d8d88672
[Not reviewed]
default
0 5 0
Mads Kiilerich - 11 years ago 2014-07-04 14:12:06
madski@unity3d.com
pull requests: show changeset comment and status flags in the changelog for PRs
5 files changed with 21 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/changeset.py
Show inline comments
 
@@ -303,24 +303,25 @@ class ChangesetController(BaseRepoContro
 
            response.content_type = 'text/plain'
 
            c.diff = safe_unicode(diff)
 
            return render('changeset/patch_changeset.html')
 
        elif method == 'raw':
 
            response.content_type = 'text/plain'
 
            return diff
 
        elif method == 'show':
 
            self.__load_data()
 
            if len(c.cs_ranges) == 1:
 
                return render('changeset/changeset.html')
 
            else:
 
                c.cs_ranges_org = None
 
                c.cs_comments = {}
 
                revs = [ctx.revision for ctx in reversed(c.cs_ranges)]
 
                c.jsdata = json.dumps(graph_data(c.db_repo_scm_instance, revs))
 
                return render('changeset/changeset_range.html')
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def index(self, revision, method='show'):
 
        return self._index(revision, method=method)
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
kallithea/controllers/compare.py
Show inline comments
 
@@ -213,33 +213,31 @@ class CompareController(BaseRepoControll
 

	
 
        c.compare_home = False
 
        c.org_repo = org_repo
 
        c.other_repo = other_repo
 
        c.org_ref_name = org_ref_name
 
        c.other_ref_name = other_ref_name
 
        c.org_ref_type = org_ref_type
 
        c.other_ref_type = other_ref_type
 

	
 
        c.cs_ranges, c.cs_ranges_org, c.ancestor = self._get_changesets(
 
            org_repo.scm_instance.alias, org_repo.scm_instance, c.org_rev,
 
            other_repo.scm_instance, c.other_rev)
 
        c.statuses = c.db_repo.statuses(
 
            [x.raw_id for x in c.cs_ranges])
 
        raw_ids = [x.raw_id for x in c.cs_ranges]
 
        c.cs_comments = other_repo.get_comments(raw_ids)
 
        c.statuses = other_repo.statuses(raw_ids)
 

	
 
        revs = [ctx.revision for ctx in reversed(c.cs_ranges)]
 
        c.jsdata = json.dumps(graph_data(c.other_repo.scm_instance, revs))
 

	
 
        c.statuses = c.db_repo.statuses([x.raw_id for x in
 
                                                   c.cs_ranges])
 

	
 
        if partial:
 
            return render('compare/compare_cs.html')
 
        if merge and c.ancestor:
 
            # case we want a simple diff without incoming changesets,
 
            # previewing what will be merged.
 
            # Make the diff on the other repo (which is known to have other_rev)
 
            log.debug('Using ancestor %s as rev1 instead of %s'
 
                      % (c.ancestor, c.org_rev))
 
            rev1 = c.ancestor
 
            org_repo = other_repo
 
        else: # comparing tips, not necessarily linearly related
 
            if merge:
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -195,25 +195,27 @@ class PullrequestsController(BaseRepoCon
 

	
 
        c.other_repo = c.org_repo
 
        (c.other_ref_type,
 
         c.other_ref_name,
 
         c.other_rev) = pull_request.other_ref.split(':')
 

	
 
        org_scm_instance = c.org_repo.scm_instance # property with expensive cache invalidation check!!!
 
        c.cs_ranges = [org_scm_instance.get_changeset(x) for x in pull_request.revisions]
 
        c.cs_ranges_org = None # not stored and not important and moving target - could be calculated ...
 
        revs = [ctx.revision for ctx in reversed(c.cs_ranges)]
 
        c.jsdata = json.dumps(graph_data(org_scm_instance, revs))
 

	
 
        c.statuses = c.org_repo.statuses([x.raw_id for x in c.cs_ranges])
 
        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'
 
        line_context = request.GET.get('context', 3)
 
        c.ignorews_url = _ignorews_url
 
        c.context_url = _context_url
 
        c.fulldiff = request.GET.get('fulldiff')
 
        diff_limit = self.cut_off_limit if not c.fulldiff else None
 

	
 
        # we swap org/other ref since we run a simple diff on one repo
 
        log.debug('running diff between %s and %s in %s'
 
                  % (c.other_rev, c.org_rev, org_scm_instance.path))
 
        txtdiff = org_scm_instance.get_diff(rev1=safe_str(c.other_rev), rev2=safe_str(c.org_rev),
kallithea/public/css/style.css
Show inline comments
 
@@ -2648,24 +2648,26 @@ BIN_FILENODE = 6
 
}
 

	
 
#graph_content .container .extra-container {
 
    display: block;
 
    position: absolute;
 
    top: -15px;
 
    right: 0;
 
    padding-left: 5px;
 
    background: #FFFFFF;
 
    height: 41px;
 
}
 

	
 
#pull_request_overview .comments-container,
 
#changeset_compare_view_content .comments-container,
 
#graph_content .comments-container,
 
#shortlog_data .comments-container,
 
#graph_content .logtags {
 
    display: block;
 
    float: left;
 
    overflow: hidden;
 
    padding: 0;
 
    margin: 0;
 
}
 

	
 
#graph_content .comments-container {
 
    margin: 0.8em 0;
 
@@ -2752,31 +2754,32 @@ BIN_FILENODE = 6
 
}
 

	
 
#graph_content .comments-cnt {
 
    color: rgb(136, 136, 136);
 
    padding: 5px 0;
 
}
 

	
 
#shortlog_data .comments-cnt {
 
    color: rgb(136, 136, 136);
 
    padding: 3px 0;
 
}
 

	
 
#pull_request_overview .comments-cnt a,
 
#changeset_compare_view_content .comments-cnt a,
 
#graph_content .comments-cnt a,
 
#shortlog_data .comments-cnt a {
 
    background-image: url('../images/icons/comments.png');
 
    background-repeat: no-repeat;
 
    background-position: 100% 50%;
 
    padding: 5px 0;
 
    padding-right: 20px;
 
}
 

	
 
.right .changes {
 
    clear: both;
 
}
 

	
 
.right .changes .changed_total {
 
    display: block;
 
    float: right;
 
    text-align: center;
 
    min-width: 45px;
 
    cursor: pointer;
kallithea/templates/compare/compare_cs.html
Show inline comments
 
@@ -16,24 +16,34 @@
 

	
 
    <div id="graph_content_pr" style="margin-left: 100px;">
 

	
 
    <table class="compare_view_commits noborder">
 
    %for cnt, cs in enumerate(reversed(c.cs_ranges)):
 
        <tr id="chg_${cnt+1}">
 
        <td style="width:50px">
 
          %if cs.raw_id in c.statuses:
 
            <div title="${_('Changeset status: %s') % c.statuses[cs.raw_id][1]}" class="changeset-status-ico">
 
                <img height="16" width="16" src="${h.url('/images/icons/flag_status_%s.png' % c.statuses[cs.raw_id][0])}" />
 
            </div>
 
          %endif
 
          %if c.cs_comments.get(cs.raw_id):
 
              <div class="comments-container">
 
                  <div class="comments-cnt" title="${_('Changeset has comments')}">
 
                      <a href="${h.url('changeset_home',repo_name=c.other_repo.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.cs_comments[cs.raw_id][0].comment_id)}">
 
                          ${len(c.cs_comments[cs.raw_id])}
 
                          <i class="icon-comment-alt icon-comment-colored"></i>
 
                      </a>
 
                  </div>
 
              </div>
 
          %endif
 
        </td>
 
        <td style="width: 140px"><span class="tooltip" title="${h.tooltip(h.age(cs.date))}">${cs.date}</span></td>
 
        <td><div class="gravatar" commit_id="${cs.raw_id}"><img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),14)}" height="14" width="14"/></div></td>
 
        <td><div class="author">${h.person(cs.author)}</div></td>
 
        <td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.other_repo.repo_name,revision=cs.raw_id))}</td>
 
        <td>
 
        %if cs.branch:
 
        <span class="branchtag">${h.link_to(cs.branch,h.url('changelog_home',repo_name=c.other_repo.repo_name,branch=cs.branch))}</span>
 
        %endif
 
        </td>
 
        <td class="expand_commit" commit_id="${cs.raw_id}" title="${_('Expand commit message')}">
 
            <i class="icon-resize-vertical" style="color:#DDD"></i>
0 comments (0 inline, 0 general)