##// END OF EJS Templates
comments: place the left over comments (outdated/misplaced) to the left or right pane....
marcink -
r2375:edf29c73 default
parent child Browse files
Show More
@@ -402,6 +402,7 b' class DiffSet(object):'
402 return diffset
402 return diffset
403
403
404 _lexer_cache = {}
404 _lexer_cache = {}
405
405 def _get_lexer_for_filename(self, filename, filenode=None):
406 def _get_lexer_for_filename(self, filename, filenode=None):
406 # cached because we might need to call it twice for source/target
407 # cached because we might need to call it twice for source/target
407 if filename not in self._lexer_cache:
408 if filename not in self._lexer_cache:
@@ -501,6 +502,9 b' class DiffSet(object):'
501 if target_file_path in self.comments_store:
502 if target_file_path in self.comments_store:
502 for lineno, comments in self.comments_store[target_file_path].items():
503 for lineno, comments in self.comments_store[target_file_path].items():
503 left_comments[lineno] = comments
504 left_comments[lineno] = comments
505 # left comments are one that we couldn't place in diff lines.
506 # could be outdated, or the diff changed and this line is no
507 # longer available
504 filediff.left_comments = left_comments
508 filediff.left_comments = left_comments
505
509
506 return filediff
510 return filediff
@@ -608,11 +612,11 b' class DiffSet(object):'
608
612
609 return lines
613 return lines
610
614
611 def get_comments_for(self, version, file, line_number):
615 def get_comments_for(self, version, filename, line_number):
612 if hasattr(file, 'unicode_path'):
616 if hasattr(filename, 'unicode_path'):
613 file = file.unicode_path
617 filename = filename.unicode_path
614
618
615 if not isinstance(file, basestring):
619 if not isinstance(filename, basestring):
616 return None
620 return None
617
621
618 line_key = {
622 line_key = {
@@ -620,8 +624,8 b' class DiffSet(object):'
620 'new': 'n',
624 'new': 'n',
621 }[version] + str(line_number)
625 }[version] + str(line_number)
622
626
623 if file in self.comments_store:
627 if filename in self.comments_store:
624 file_comments = self.comments_store[file]
628 file_comments = self.comments_store[filename]
625 if line_key in file_comments:
629 if line_key in file_comments:
626 return file_comments.pop(line_key)
630 return file_comments.pop(line_key)
627
631
@@ -235,12 +235,18 b' collapse_all = len(diffset.files) > coll'
235 <tr class="cb-line">
235 <tr class="cb-line">
236 <td class="cb-data cb-context"></td>
236 <td class="cb-data cb-context"></td>
237 <td class="cb-lineno cb-context"></td>
237 <td class="cb-lineno cb-context"></td>
238 <td class="cb-content cb-context"></td>
238 <td class="cb-content cb-context">
239 % if lineno.startswith('o'):
240 ${inline_comments_container(comments)}
241 % endif
242 </td>
239
243
240 <td class="cb-data cb-context"></td>
244 <td class="cb-data cb-context"></td>
241 <td class="cb-lineno cb-context"></td>
245 <td class="cb-lineno cb-context"></td>
242 <td class="cb-content cb-context">
246 <td class="cb-content cb-context">
247 % if lineno.startswith('n'):
243 ${inline_comments_container(comments)}
248 ${inline_comments_container(comments)}
249 % endif
244 </td>
250 </td>
245 </tr>
251 </tr>
246 %endif
252 %endif
General Comments 0
You need to be logged in to leave comments. Login now