SideBySide2: Add range to PatchLineComment

Added a column named "range", a quadruple
(start_line, start_character, end_line, end_character) that
represents a comment range.

Modified RPCs to include the range info.

Updated schema to version 80.

Change-Id: Idec295e15e3ab019ea04e4c2f3967eeecc0be55c
This commit is contained in:
Michael Zhou
2013-08-07 19:12:25 -07:00
parent 72e898377a
commit 47de995b87
14 changed files with 222 additions and 19 deletions

View File

@@ -84,12 +84,18 @@ class SaveDraft extends Handler<PatchLineComment> {
throw new IllegalStateException("Parent comment must be on same side");
}
}
if (comment.getRange() != null
&& comment.getLine() != comment.getRange().getEndLine()) {
throw new IllegalStateException(
"Range endLine must be on the same line as the comment");
}
final PatchLineComment nc =
new PatchLineComment(new PatchLineComment.Key(patchKey, ChangeUtil
.messageUUID(db)), comment.getLine(), me, comment.getParentUuid());
nc.setSide(comment.getSide());
nc.setMessage(comment.getMessage());
nc.setRange(comment.getRange());
db.patchComments().insert(Collections.singleton(nc));
db.commit();
return nc;