Add and use ReviewChangeset.review_level_comments.
author |
Steve Losh <steve@stevelosh.com> |
date |
Tue, 02 Mar 2010 18:50:26 -0500 |
parents |
99b7409c4b45
|
children |
2d471b406299
|
branches/tags |
(none) |
files |
.venv review/api.py review/extension_ui.py review/web_templates/review.html |
Changes
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.venv Tue Mar 02 18:50:26 2010 -0500
@@ -0,0 +1,1 @@
+hg-review
--- a/review/api.py Tue Mar 02 18:43:34 2010 -0500
+++ b/review/api.py Tue Mar 02 18:50:26 2010 -0500
@@ -480,6 +480,12 @@
return ds
+
+ @property
+ def review_level_comments(self):
+ """Comments on this changeset which aren't on a particular file."""
+ return filter(lambda c: not c.filename, self.comments)
+
class _ReviewObject(object):
"""A base object for some kind of review data (a signoff or comment)."""
@@ -657,3 +663,4 @@
return file_templates.SIGNOFF_FILE_TEMPLATE % ( self.author, rendered_date,
self.node, self.opinion, self.message )
+
--- a/review/extension_ui.py Tue Mar 02 18:43:34 2010 -0500
+++ b/review/extension_ui.py Tue Mar 02 18:50:26 2010 -0500
@@ -153,7 +153,7 @@
for signoff in rcset.signoffs:
_print_signoff(signoff, before='\n')
- review_level_comments = filter(lambda c: not c.filename, rcset.comments)
+ review_level_comments = rcset.review_level_comments
if review_level_comments:
ui.write('\n')
for comment in review_level_comments:
--- a/review/web_templates/review.html Tue Mar 02 18:43:34 2010 -0500
+++ b/review/web_templates/review.html Tue Mar 02 18:50:26 2010 -0500
@@ -3,7 +3,7 @@
$ ctx = rd.target[rcset.node]
<h2>Changeset ${ ctx.rev() }: ${ ctx.description() }</h2>
-$ review_level_comments = filter(lambda c: not c.filename, rcset.comments)
+$ review_level_comments = rcset.review_level_comments
$for comment in review_level_comments:
<div class="comment">
<div class="avatar"><img height="52" width="52" src="http://www.gravatar.com/avatar/${ md5(email(comment.author)).hexdigest() }?s=52"/></div>