##// END OF EJS Templates
added changeset review status into repo/branch compare view
marcink -
r2393:b94eac50 codereview
parent child Browse files
Show More
@@ -49,7 +49,6 b' class CompareController(BaseRepoControll'
49 def __before__(self):
49 def __before__(self):
50 super(CompareController, self).__before__()
50 super(CompareController, self).__before__()
51
51
52
53 def _get_discovery(self, org_repo, org_ref, other_repo, other_ref):
52 def _get_discovery(self, org_repo, org_ref, other_repo, other_ref):
54 from mercurial import discovery
53 from mercurial import discovery
55 other = org_repo._repo
54 other = org_repo._repo
@@ -119,6 +118,10 b' class CompareController(BaseRepoControll'
119 other_ref,
118 other_ref,
120 discovery_data)
119 discovery_data)
121
120
121 c.statuses = c.rhodecode_db_repo.statuses([x.raw_id for x in
122 c.cs_ranges])
123
124
122 c.org_ref = org_ref[1]
125 c.org_ref = org_ref[1]
123 c.other_ref = other_ref[1]
126 c.other_ref = other_ref[1]
124 # diff needs to have swapped org with other to generate proper diff
127 # diff needs to have swapped org with other to generate proper diff
@@ -129,9 +132,8 b' class CompareController(BaseRepoControll'
129
132
130 c.files = []
133 c.files = []
131 c.changes = {}
134 c.changes = {}
132 # sort Added first then Modified last Deleted files
135
133 sorter = lambda info: {'A': 0, 'M': 1, 'D': 2}.get(info['operation'])
136 for f in _parsed:
134 for f in sorted(_parsed, key=sorter):
135 fid = h.FID('', f['filename'])
137 fid = h.FID('', f['filename'])
136 c.files.append([fid, f['operation'], f['filename'], f['stats']])
138 c.files.append([fid, f['operation'], f['filename'], f['stats']])
137 diff = diff_processor.as_html(enable_comments=False, diff_lines=[f])
139 diff = diff_processor.as_html(enable_comments=False, diff_lines=[f])
@@ -38,14 +38,14 b''
38 %for cnt, cs in enumerate(c.cs_ranges):
38 %for cnt, cs in enumerate(c.cs_ranges):
39 <tr>
39 <tr>
40 <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),14)}"/></div></td>
40 <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),14)}"/></div></td>
41 <td>
42 %if cs.raw_id in c.statuses:
43 <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>
44 %endif
45 </td>
41 <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>
46 <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>
42 <td><div class="author">${h.person(cs.author)}</div></td>
47 <td><div class="author">${h.person(cs.author)}</div></td>
43 <td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td>
48 <td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td>
44 <td>
45 %if hasattr(c,'statuses') and c.statuses:
46 <div title="${_('Changeset status')}" class="changeset-status-ico"><img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses[cnt])}" /></div>
47 %endif
48 </td>
49 <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div></td>
49 <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div></td>
50 </tr>
50 </tr>
51 %endfor
51 %endfor
General Comments 0
You need to be logged in to leave comments. Login now