Class DeleteCommentRewriter

java.lang.Object
com.google.gerrit.server.notedb.DeleteCommentRewriter
All Implemented Interfaces:
NoteDbRewriter

public class DeleteCommentRewriter extends Object implements 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.
  • Method Details

    • getRefName

      public String getRefName()
      Description copied from interface: NoteDbRewriter
      Gets the name of the target ref which will be rewritten.
      Specified by:
      getRefName in interface NoteDbRewriter
    • 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 interface NoteDbRewriter
      Parameters:
      revWalk - a RevWalk instance.
      inserter - a ObjectInserter instance.
      currTip - the ObjectId 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