public class ChangeUpdate extends AbstractChangeUpdate
This delta will become two unique commits: one in the AllUsers repo that will contain the draft comments on this change and one in the notes branch that will contain approvals, reviewers, change status, subject, submit records, the change message, and published comments. There are limitations on the set of modifications that can be handled in a single update. In particular, there is a single author and timestamp for each update.
This class is not thread-safe.
Modifier and Type | Class and Description |
---|---|
static interface |
ChangeUpdate.Factory |
accountId, authorIdent, NO_OP_UPDATE, noteUtil, psId, realAccountId, rootOnly, serverIdent, when
Modifier and Type | Method and Description |
---|---|
boolean |
allowWriteToNewRef() |
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)
Create a commit containing the contents of this update.
|
org.eclipse.jgit.lib.ObjectId |
commit() |
void |
deleteChangeMessageByRewritingHistory(java.lang.String targetMessageId,
java.lang.String newMessage) |
void |
deleteComment(Comment c) |
void |
deleteCommentByRewritingHistory(java.lang.String uuid,
java.lang.String newMessage) |
void |
fixStatus(Change.Status status) |
DeleteChangeMessageRewriter |
getDeleteChangeMessageRewriter() |
DeleteCommentRewriter |
getDeleteCommentRewriter() |
protected Project.NameKey |
getProjectName() |
protected java.lang.String |
getRefName() |
java.util.Map<Account.Id,ReviewerStateInternal> |
getReviewers() |
boolean |
isEmpty()
Whether no updates have been done.
|
void |
merge(com.google.gerrit.server.logging.RequestId submissionId,
java.lang.Iterable<SubmitRecord> submitRecords) |
void |
putApproval(java.lang.String label,
short value) |
void |
putApprovalFor(Account.Id reviewer,
java.lang.String label,
short value) |
void |
putComment(PatchLineComment.Status status,
Comment c) |
void |
putReviewer(Account.Id reviewer,
ReviewerStateInternal type) |
void |
putReviewerByEmail(com.google.gerrit.mail.Address reviewer,
ReviewerStateInternal type) |
void |
putRobotComment(RobotComment c) |
void |
removeApproval(java.lang.String label) |
void |
removeApprovalFor(Account.Id reviewer,
java.lang.String label) |
void |
removeAssignee() |
void |
removeReviewer(Account.Id reviewer) |
void |
removeReviewerByEmail(com.google.gerrit.mail.Address reviewer) |
void |
setAllowWriteToNewRef(boolean allow) |
void |
setAssignee(Account.Id assignee) |
void |
setBranch(java.lang.String branch) |
void |
setChangeId(java.lang.String changeId) |
void |
setChangeMessage(java.lang.String changeMessage) |
void |
setCommit(org.eclipse.jgit.revwalk.RevWalk rw,
org.eclipse.jgit.lib.ObjectId id) |
void |
setCommit(org.eclipse.jgit.revwalk.RevWalk rw,
org.eclipse.jgit.lib.ObjectId id,
java.lang.String pushCert) |
void |
setCurrentPatchSet() |
void |
setGroups(java.util.List<java.lang.String> groups) |
void |
setHashtags(java.util.Set<java.lang.String> hashtags) |
void |
setPatchSetState(PatchSetState psState) |
void |
setPrivate(boolean isPrivate) |
void |
setPsDescription(java.lang.String psDescription) |
void |
setRevertOf(int revertOf) |
void |
setRevisionForMissingCommit(java.lang.String id,
java.lang.String pushCert)
Set the revision without depending on the commit being present in the repository; should only
be used for converting old corrupt commits.
|
void |
setStatus(Change.Status status) |
void |
setSubject(java.lang.String subject) |
void |
setSubjectForCommit(java.lang.String commitSubject) |
void |
setSubmissionId(java.lang.String submissionId)
Deprecated.
|
void |
setTag(java.lang.String tag) |
void |
setTopic(java.lang.String topic) |
void |
setWorkInProgress(boolean workInProgress) |
getAccountId, getChange, getId, getNotes, getNullableAccountId, getPatchSetId, getWhen, isRootOnly, newIdent, setParentCommit, setPatchSetId, verifyComment
public org.eclipse.jgit.lib.ObjectId commit() throws java.io.IOException
java.io.IOException
public void setChangeId(java.lang.String changeId)
public void setBranch(java.lang.String branch)
public void setStatus(Change.Status status)
public void fixStatus(Change.Status status)
public void putApproval(java.lang.String label, short value)
public void putApprovalFor(Account.Id reviewer, java.lang.String label, short value)
public void removeApproval(java.lang.String label)
public void removeApprovalFor(Account.Id reviewer, java.lang.String label)
public void merge(com.google.gerrit.server.logging.RequestId submissionId, java.lang.Iterable<SubmitRecord> submitRecords)
@Deprecated public void setSubmissionId(java.lang.String submissionId)
public void setSubjectForCommit(java.lang.String commitSubject)
public void setSubject(java.lang.String subject)
public void setChangeMessage(java.lang.String changeMessage)
public void setTag(java.lang.String tag)
public void setPsDescription(java.lang.String psDescription)
public void putComment(PatchLineComment.Status status, Comment c)
public void putRobotComment(RobotComment c)
public void deleteComment(Comment c)
public void deleteCommentByRewritingHistory(java.lang.String uuid, java.lang.String newMessage)
public void deleteChangeMessageByRewritingHistory(java.lang.String targetMessageId, java.lang.String newMessage)
public void setTopic(java.lang.String topic)
public void setCommit(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId id) throws java.io.IOException
java.io.IOException
public void setCommit(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId id, java.lang.String pushCert) throws java.io.IOException
java.io.IOException
public void setRevisionForMissingCommit(java.lang.String id, java.lang.String pushCert)
public void setHashtags(java.util.Set<java.lang.String> hashtags)
public void setAssignee(Account.Id assignee)
public void removeAssignee()
public java.util.Map<Account.Id,ReviewerStateInternal> getReviewers()
public void putReviewer(Account.Id reviewer, ReviewerStateInternal type)
public void removeReviewer(Account.Id reviewer)
public void putReviewerByEmail(com.google.gerrit.mail.Address reviewer, ReviewerStateInternal type)
public void removeReviewerByEmail(com.google.gerrit.mail.Address reviewer)
public void setPatchSetState(PatchSetState psState)
public void setCurrentPatchSet()
public void setGroups(java.util.List<java.lang.String> groups)
public void setRevertOf(int revertOf)
protected java.lang.String getRefName()
getRefName
in class AbstractChangeUpdate
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 java.io.IOException
AbstractChangeUpdate
applyImpl
in class AbstractChangeUpdate
ins
- inserter to write to; callers should not flush.AbstractChangeUpdate.isEmpty()
), return the
sentinel AbstractChangeUpdate.NO_OP_UPDATE
.java.io.IOException
- if a lower-level error occurred.protected Project.NameKey getProjectName()
getProjectName
in class AbstractChangeUpdate
public boolean isEmpty()
AbstractChangeUpdate
isEmpty
in class AbstractChangeUpdate
public DeleteCommentRewriter getDeleteCommentRewriter()
public DeleteChangeMessageRewriter getDeleteChangeMessageRewriter()
public void setAllowWriteToNewRef(boolean allow)
public boolean allowWriteToNewRef()
allowWriteToNewRef
in class AbstractChangeUpdate
public void setPrivate(boolean isPrivate)
public void setWorkInProgress(boolean workInProgress)