# HG changeset patch # User Christophe de Vienne # Date 1418379463 -3600 # Node ID acf857ef0abe481e0c7db122dad15d8dcfd52242 # Parent af974f8d1eec70ecc902b897416af8e88a05e68a# Parent 16e0bcd4f8540a17eb402e0e832eeef068cd6bda Merge upstream diff -r af974f8d1eec -r acf857ef0abe README.markdown --- a/README.markdown Wed Dec 17 10:21:27 2014 +0100 +++ b/README.markdown Fri Dec 12 11:17:43 2014 +0100 @@ -4,7 +4,7 @@ Installing ========== -`hg-review` requires Mercurial 1.6+ and Python 2.5+. It requires a few other +`hg-review` requires Mercurial 3.2+ and Python 2.5+. It requires a few other things too, but they're bundled with the extension so you don't need to worry about them. diff -r af974f8d1eec -r acf857ef0abe review/api.py --- a/review/api.py Wed Dec 17 10:21:27 2014 +0100 +++ b/review/api.py Fri Dec 12 11:17:43 2014 +0100 @@ -9,6 +9,7 @@ from mercurial.node import hex from mercurial import ui as _ui from mercurial import demandimport +from mercurial import obsolete demandimport.ignore.append('json') try: @@ -454,25 +455,35 @@ self.target = target self.ui = ui self.node = node - - if '%s/.exists' % self.node in self.repo['tip']: - _match = lambda p: lambda fn: fn.startswith(p) + self.allnodes = [ + hex(n) for n in obsolete.allprecursors( + target.obsstore, (self.node.decode('hex'),)) + ] - relevant = filter(_match(node), self.repo['tip']) - commentfns = filter(_match('%s/comments' % node), relevant) - signofffns = filter(_match('%s/signoffs' % node), relevant) + self.comments = [] + self.signoffs = [] + + _match = lambda p: lambda fn: fn.startswith(p) + + for node in self.allnodes: + if '%s/.exists' % node in self.repo['tip']: - self.comments = [self._load_comment_file(fn) for fn in commentfns] - self.comments.sort(key=operator.attrgetter('local_datetime')) + relevant = filter(_match(node), self.repo['tip']) + commentfns = filter(_match('%s/comments' % node), relevant) + signofffns = filter(_match('%s/signoffs' % node), relevant) - self.signoffs = [self._load_signoff_file(fn) for fn in signofffns] - self.signoffs.sort(key=operator.attrgetter('local_datetime')) - else: - self.comments = [] - self.signoffs = [] + self.comments.extend( + [self._load_comment_file(fn) for fn in commentfns]) + + self.signoffs.extend( + [self._load_signoff_file(fn) for fn in signofffns]) + + self.comments.sort(key=operator.attrgetter('local_datetime')) + self.signoffs.sort(key=operator.attrgetter('local_datetime')) def signoffs_for_user(self, username): - return filter(lambda s: s.author == username, self.signoffs) + return filter(lambda s: s.node == self.node + and s.author == username, self.signoffs) def signoffs_for_current_user(self): return self.signoffs_for_user(fromlocal(self.ui.username())) @@ -492,8 +503,7 @@ if existing: raise SignoffExists - if not (self.comments or self.signoffs): - self._create_exists_entry() + self._create_exists_entry() signoff = ReviewSignoff(fromlocal(self.ui.username()), util.makedate(), self.node, opinion, message, style) @@ -518,8 +528,7 @@ if filename and not ufilename: ufilename = fromlocal(filename) - if not (self.comments or self.signoffs): - self._create_exists_entry() + self._create_exists_entry() comment = ReviewComment(fromlocal(self.ui.username()), util.makedate(), self.node, ufilename, filename, map(int, lines), message, style) diff -r af974f8d1eec -r acf857ef0abe review/static/styles/style.less --- a/review/static/styles/style.less Wed Dec 17 10:21:27 2014 +0100 +++ b/review/static/styles/style.less Fri Dec 12 11:17:43 2014 +0100 @@ -251,6 +251,12 @@ background-color: lighten(@c-cream, 8%); } + &.draft { + .rev { + border: 1px solid blue; + } + } + td { border: none; line-height: 26px; @@ -455,6 +461,10 @@ border-bottom: 1px solid #ddd; position: relative; min-height: 41px; + + &.obsolete { + opacity: 0.6; + } &:first-child { border-top: none; @@ -634,6 +644,10 @@ border-top: 1px solid #ddd; background-color: #f4f4f4; + &.obsolete { + opacity: 0.6; + } + .avatar { float: right; margin-top: 2px; diff -r af974f8d1eec -r acf857ef0abe review/templates/index.html --- a/review/templates/index.html Wed Dec 17 10:21:27 2014 +0100 +++ b/review/templates/index.html Fri Dec 12 11:17:43 2014 +0100 @@ -8,10 +8,11 @@ {% for rcset in rcsets %} {% set rev = rcset.target[rcset.node] %} + {% set phase = rev.phasestr() %} {% set node_short = utils['node_short'](rev.node()) %} {% set link = "/changeset/" + node_short + "/" %} - +
{{ rev.rev() }}:{{ node_short }} {{ utils['person'](rev.user()) }} diff -r af974f8d1eec -r acf857ef0abe review/templates/pieces/comment.html --- a/review/templates/pieces/comment.html Wed Dec 17 10:21:27 2014 +0100 +++ b/review/templates/pieces/comment.html Fri Dec 12 11:17:43 2014 +0100 @@ -1,8 +1,12 @@ {% if comment.style == 'markdown' %} {% set rendered = utils['markdown'](comment.message) %} {% endif %} +{% if comment.node != rev.hex() %} + {% set obsolete = True %} + {% set obsclass = ' obsolete' %} +{% endif %} -
+