Class ChangeDraftUpdate


  • public class ChangeDraftUpdate
    extends AbstractChangeUpdate
    A single delta to apply atomically to a change.

    This delta contains only draft comments on a single patch set of a change by a single author. This delta will become a single commit in the All-Users repository.

    This class is not thread safe.

    • Method Detail

      • markCommentPublished

        public void markCommentPublished​(HumanComment c)
        Marks a comment for deletion. Called when the comment is deleted because the user published it.
      • deleteComment

        public void deleteComment​(HumanComment c)
        Marks a comment for deletion. Called when the comment is deleted because the user removed it.
      • deleteComment

        public void deleteComment​(org.eclipse.jgit.lib.ObjectId commitId,
                                  Comment.Key key)
        Marks a comment for deletion. Called when the comment should have been deleted previously, but wasn't, so we're fixing it up.
      • canRunAsync

        public boolean canRunAsync()
        Returns true if all we do in this operations is deletes caused by publishing or fixing up comments.
      • applyImpl

        protected org.eclipse.jgit.lib.CommitBuilder applyImpl​(org.eclipse.jgit.revwalk.RevWalk rw,
                                                               org.eclipse.jgit.lib.ObjectInserter ins,
                                                               org.eclipse.jgit.lib.ObjectId curr)
                                                        throws IOException
        Description copied from class: AbstractChangeUpdate
        Create a commit containing the contents of this update.
        Specified by:
        applyImpl in class AbstractChangeUpdate
        ins - inserter to write to; callers should not flush.
        Returns:
        a new commit builder representing this commit, or null to indicate the meta ref should be deleted as a result of this update. The parent, author, and committer fields in the return value are always overwritten. The tree ID may be unset by this method, which indicates to the caller that it should be copied from the parent commit. To indicate that this update is a no-op (but this could not be determined by AbstractChangeUpdate.isEmpty()), return the sentinel AbstractChangeUpdate.NO_OP_UPDATE.
        Throws:
        IOException - if a lower-level error occurred.
      • setParentCommit

        protected void setParentCommit​(org.eclipse.jgit.lib.CommitBuilder cb,
                                       org.eclipse.jgit.lib.ObjectId parentCommitId)
        Overrides:
        setParentCommit in class AbstractChangeUpdate