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, anonymousCowardName, authorIdent, migration, NO_OP_UPDATE, noteUtil, psId, realAccountId, 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.
|
protected void |
checkNotReadOnly() |
org.eclipse.jgit.lib.ObjectId |
commit() |
void |
deleteComment(Comment c) |
void |
fixStatus(Change.Status status) |
protected Project.NameKey |
getProjectName() |
protected String |
getRefName() |
Map<Account.Id,ReviewerStateInternal> |
getReviewers() |
boolean |
isEmpty()
Whether no updates have been done.
|
void |
merge(RequestId submissionId,
Iterable<SubmitRecord> submitRecords) |
void |
putApproval(String label,
short value) |
void |
putApprovalFor(Account.Id reviewer,
String label,
short value) |
void |
putComment(PatchLineComment.Status status,
Comment c) |
void |
putReviewer(Account.Id reviewer,
ReviewerStateInternal type) |
void |
putRobotComment(RobotComment c) |
void |
removeApproval(String label) |
void |
removeApprovalFor(Account.Id reviewer,
String label) |
void |
removeAssignee() |
void |
removeReviewer(Account.Id reviewer) |
void |
setAllowWriteToNewRef(boolean allow) |
void |
setAssignee(Account.Id assignee) |
void |
setBranch(String branch) |
void |
setChangeId(String changeId) |
void |
setChangeMessage(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,
String pushCert) |
void |
setCurrentPatchSet() |
void |
setGroups(List<String> groups) |
void |
setHashtags(Set<String> hashtags) |
void |
setPatchSetState(PatchSetState psState) |
void |
setPsDescription(String psDescription) |
void |
setRevisionForMissingCommit(String id,
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(String subject) |
void |
setSubjectForCommit(String commitSubject) |
void |
setSubmissionId(String submissionId)
Deprecated.
|
void |
setTag(String tag) |
void |
setTopic(String topic) |
getAccountId, getChange, getId, getNotes, getNullableAccountId, getPatchSetId, getWhen, newIdent, setPatchSetId, verifyComment
public org.eclipse.jgit.lib.ObjectId commit() throws IOException, com.google.gwtorm.server.OrmException
IOException
com.google.gwtorm.server.OrmException
public void setChangeId(String changeId)
public void setBranch(String branch)
public void setStatus(Change.Status status)
public void fixStatus(Change.Status status)
public void putApproval(String label, short value)
public void putApprovalFor(Account.Id reviewer, String label, short value)
public void removeApproval(String label)
public void removeApprovalFor(Account.Id reviewer, String label)
public void merge(RequestId submissionId, Iterable<SubmitRecord> submitRecords)
@Deprecated public void setSubmissionId(String submissionId)
public void setSubjectForCommit(String commitSubject)
public void setSubject(String subject)
public void setChangeMessage(String changeMessage)
public void setTag(String tag)
public void setPsDescription(String psDescription)
public void putComment(PatchLineComment.Status status, Comment c)
public void putRobotComment(RobotComment c)
public void deleteComment(Comment c)
public void setTopic(String topic)
public void setCommit(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId id) throws IOException
IOException
public void setCommit(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId id, String pushCert) throws IOException
IOException
public void setRevisionForMissingCommit(String id, String pushCert)
public void setAssignee(Account.Id assignee)
public void removeAssignee()
public Map<Account.Id,ReviewerStateInternal> getReviewers()
public void putReviewer(Account.Id reviewer, ReviewerStateInternal type)
public void removeReviewer(Account.Id reviewer)
public void setPatchSetState(PatchSetState psState)
public void setCurrentPatchSet()
protected 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 com.google.gwtorm.server.OrmException, IOException
AbstractChangeUpdate
applyImpl
in class AbstractChangeUpdate
ins
- inserter to write to; callers should not flush.AbstractChangeUpdate.isEmpty()
), return the
sentinel AbstractChangeUpdate.NO_OP_UPDATE
.com.google.gwtorm.server.OrmException
- if a Gerrit-level error occurred.IOException
- if a lower-level error occurred.protected Project.NameKey getProjectName()
getProjectName
in class AbstractChangeUpdate
public boolean isEmpty()
AbstractChangeUpdate
isEmpty
in class AbstractChangeUpdate
public void setAllowWriteToNewRef(boolean allow)
public boolean allowWriteToNewRef()
allowWriteToNewRef
in class AbstractChangeUpdate
protected void checkNotReadOnly() throws com.google.gwtorm.server.OrmException
checkNotReadOnly
in class AbstractChangeUpdate
com.google.gwtorm.server.OrmException