Merge "Add inline comments to change overview"
This commit is contained in:
commit
2e277a7897
|
@ -18,6 +18,7 @@ DEFAULT_PALETTE={
|
|||
'error': ['light red', 'dark blue'],
|
||||
'table-header': ['white,bold', ''],
|
||||
'filename': ['light cyan', ''],
|
||||
'filename-inline-comment': ['dark cyan', ''],
|
||||
'focused-filename': ['light cyan,standout', ''],
|
||||
'positive-label': ['dark green', ''],
|
||||
'negative-label': ['dark red', ''],
|
||||
|
|
|
@ -446,6 +446,29 @@ class ChangeMessageBox(mywid.HyperText):
|
|||
comment_text = ['\n'.join(lines)]
|
||||
for commentlink in self.app.config.commentlinks:
|
||||
comment_text = commentlink.run(self.app, comment_text)
|
||||
|
||||
inline_comments = {}
|
||||
for file in message.revision.files:
|
||||
comments = [c for c in file.comments
|
||||
if c.author.id == message.author.id
|
||||
and c.created == message.created]
|
||||
for comment in comments:
|
||||
path = comment.file.path
|
||||
inline_comments.setdefault(path, [])
|
||||
inline_comments[path].append((comment.line, comment.message))
|
||||
for v in inline_comments.values():
|
||||
v.sort()
|
||||
|
||||
if inline_comments:
|
||||
comment_text.append(u'\n')
|
||||
for key, value in inline_comments.items():
|
||||
comment_text.append(('filename-inline-comment', u'%s' % key))
|
||||
for line, comment in value:
|
||||
if line is None:
|
||||
comment_text.append(u'\n %s' % comment)
|
||||
else:
|
||||
comment_text.append(u'\n %s: %s\n' % (line, comment))
|
||||
|
||||
self.set_text(text+comment_text)
|
||||
|
||||
class CommitMessageBox(mywid.HyperText):
|
||||
|
|
Loading…
Reference in New Issue