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