Package com.google.gerrit.server.notedb
Class DeleteCommentRewriter
java.lang.Object
com.google.gerrit.server.notedb.DeleteCommentRewriter
- All Implemented Interfaces:
NoteDbRewriter
Deletes a published comment from NoteDb by rewriting the commit history. Instead of deleting the
whole comment, it just replaces the comment's message with a new message.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String,
HumanComment> getPublishedComments
(ChangeNoteJson changeNoteJson, org.eclipse.jgit.lib.ObjectReader reader, org.eclipse.jgit.notes.NoteMap noteMap) Gets all the comments which are presented at a commit.static Map<String,
HumanComment> getPublishedComments
(ChangeNoteUtil noteUtil, org.eclipse.jgit.lib.ObjectReader reader, org.eclipse.jgit.notes.NoteMap noteMap) Gets the name of the target ref which will be rewritten.org.eclipse.jgit.lib.ObjectId
rewriteCommitHistory
(org.eclipse.jgit.revwalk.RevWalk revWalk, org.eclipse.jgit.lib.ObjectInserter inserter, org.eclipse.jgit.lib.ObjectId currTip) Rewrites the commit history.
-
Method Details
-
getRefName
Description copied from interface:NoteDbRewriter
Gets the name of the target ref which will be rewritten.- Specified by:
getRefName
in interfaceNoteDbRewriter
-
rewriteCommitHistory
public org.eclipse.jgit.lib.ObjectId rewriteCommitHistory(org.eclipse.jgit.revwalk.RevWalk revWalk, org.eclipse.jgit.lib.ObjectInserter inserter, org.eclipse.jgit.lib.ObjectId currTip) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException Description copied from interface:NoteDbRewriter
Rewrites the commit history.- Specified by:
rewriteCommitHistory
in interfaceNoteDbRewriter
- Parameters:
revWalk
- aRevWalk
instance.inserter
- aObjectInserter
instance.currTip
- theObjectId
of the ref's tip commit.- Returns:
- the
ObjectId
of the ref's new tip commit. - Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
getPublishedComments
public static Map<String,HumanComment> getPublishedComments(ChangeNoteJson changeNoteJson, org.eclipse.jgit.lib.ObjectReader reader, org.eclipse.jgit.notes.NoteMap noteMap) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException Gets all the comments which are presented at a commit. Note they include the comments put in by the previous commits.- Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
getPublishedComments
public static Map<String,HumanComment> getPublishedComments(ChangeNoteUtil noteUtil, org.eclipse.jgit.lib.ObjectReader reader, org.eclipse.jgit.notes.NoteMap noteMap) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-