Add draft comments to PatchLineCommentsUtil

I added the ability to read and write published comments from either
the notedb or the ReviewDb depending on the state of the
NotesMigration instance. Additionally, I modified all callers of
PatchLineCommentAccess that query for or edit comments to use the
corresponding methods in PatchLineCommentsUtil.

I added a new test to CommentsTest to test the reading and
writing of draft comments from both the notedb and the ReviewDb with
these new PatchLineCommentsUtil methods.

Finally, I added a full integration test for inline comments in
CommentsIT.java.

Change-Id: Iac4ea144497fe68d28c3e886b91c7698741d6615
This commit is contained in:
Yacob Yonas
2014-07-25 09:45:07 -07:00
parent 0223ebc8cf
commit 5020ff2fd0
24 changed files with 785 additions and 168 deletions

View File

@@ -508,8 +508,8 @@ public class ChangeUtil {
ReviewDb db = this.db.get();
db.accountPatchReviews().delete(db.accountPatchReviews().byPatchSet(patchSetId));
db.changeMessages().delete(db.changeMessages().byPatchSet(patchSetId));
db.patchComments().delete(db.patchComments().byPatchSet(patchSetId));
// No need to delete from notedb; draft patch sets will be filtered out.
db.patchComments().delete(db.patchComments().byPatchSet(patchSetId));
db.patchSetApprovals().delete(db.patchSetApprovals().byPatchSet(patchSetId));
db.patchSetAncestors().delete(db.patchSetAncestors().byPatchSet(patchSetId));