##// END OF EJS Templates
comments: don't mark draft comments as outdated.
milka -
r4556:e8115e8a default
parent child Browse files
Show More
@@ -722,7 +722,8 b' class CommentsModel(BaseModel):'
722 path=comment.f_path, diff_line=diff_line)
722 path=comment.f_path, diff_line=diff_line)
723 except (diffs.LineNotInDiffException,
723 except (diffs.LineNotInDiffException,
724 diffs.FileNotInDiffException):
724 diffs.FileNotInDiffException):
725 comment.display_state = ChangesetComment.COMMENT_OUTDATED
725 if not comment.draft:
726 comment.display_state = ChangesetComment.COMMENT_OUTDATED
726 return
727 return
727
728
728 if old_context == new_context:
729 if old_context == new_context:
@@ -732,14 +733,15 b' class CommentsModel(BaseModel):'
732 new_diff_lines = new_diff_proc.find_context(
733 new_diff_lines = new_diff_proc.find_context(
733 path=comment.f_path, context=old_context,
734 path=comment.f_path, context=old_context,
734 offset=self.DIFF_CONTEXT_BEFORE)
735 offset=self.DIFF_CONTEXT_BEFORE)
735 if not new_diff_lines:
736 if not new_diff_lines and not comment.draft:
736 comment.display_state = ChangesetComment.COMMENT_OUTDATED
737 comment.display_state = ChangesetComment.COMMENT_OUTDATED
737 else:
738 else:
738 new_diff_line = self._choose_closest_diff_line(
739 new_diff_line = self._choose_closest_diff_line(
739 diff_line, new_diff_lines)
740 diff_line, new_diff_lines)
740 comment.line_no = _diff_to_comment_line_number(new_diff_line)
741 comment.line_no = _diff_to_comment_line_number(new_diff_line)
741 else:
742 else:
742 comment.display_state = ChangesetComment.COMMENT_OUTDATED
743 if not comment.draft:
744 comment.display_state = ChangesetComment.COMMENT_OUTDATED
743
745
744 def _should_relocate_diff_line(self, diff_line):
746 def _should_relocate_diff_line(self, diff_line):
745 """
747 """
General Comments 0
You need to be logged in to leave comments. Login now