public class ChangeUpdate extends VersionedMetaData
This delta becomes a single commit on the notes branch, so 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 |
VersionedMetaData.BatchMetaDataUpdate
inserter, newTree, reader
Modifier and Type | Method and Description |
---|---|
org.eclipse.jgit.revwalk.RevCommit |
commit() |
org.eclipse.jgit.revwalk.RevCommit |
commit(MetaDataUpdate md)
Update this metadata branch, recording a new commit on its reference.
|
com.google.gerrit.reviewdb.client.Change |
getChange() |
protected String |
getRefName() |
IdentifiedUser |
getUser() |
Date |
getWhen() |
protected void |
onLoad()
Set up the metadata, parsing any state from the loaded revision.
|
protected boolean |
onSave(org.eclipse.jgit.lib.CommitBuilder commit)
Save any changes to the metadata in a commit.
|
VersionedMetaData.BatchMetaDataUpdate |
openUpdate() |
VersionedMetaData.BatchMetaDataUpdate |
openUpdate(MetaDataUpdate update) |
void |
putApproval(String label,
short value) |
void |
putReviewer(com.google.gerrit.reviewdb.client.Account.Id reviewer,
ReviewerState type) |
void |
removeApproval(String label) |
void |
removeReviewer(com.google.gerrit.reviewdb.client.Account.Id reviewer) |
void |
setPatchSetId(com.google.gerrit.reviewdb.client.PatchSet.Id psId) |
void |
setStatus(com.google.gerrit.reviewdb.client.Change.Status status) |
void |
setSubject(String subject) |
void |
submit(Iterable<com.google.gerrit.common.data.SubmitRecord> submitRecords) |
commitToNewRef, getObjectId, getRevision, load, load, load, load, readConfig, readFile, readTree, readUTF8, saveConfig, saveFile, saveUTF8, set, set, set
public com.google.gerrit.reviewdb.client.Change getChange()
public IdentifiedUser getUser()
public Date getWhen()
public void setStatus(com.google.gerrit.reviewdb.client.Change.Status status)
public void putApproval(String label, short value)
public void removeApproval(String label)
public void submit(Iterable<com.google.gerrit.common.data.SubmitRecord> submitRecords)
public void setSubject(String subject)
public void setPatchSetId(com.google.gerrit.reviewdb.client.PatchSet.Id psId)
public void putReviewer(com.google.gerrit.reviewdb.client.Account.Id reviewer, ReviewerState type)
public void removeReviewer(com.google.gerrit.reviewdb.client.Account.Id reviewer)
public org.eclipse.jgit.revwalk.RevCommit commit(MetaDataUpdate md) throws IOException
VersionedMetaData
commit
in class VersionedMetaData
md
- helper information to define the update that will occur.IOException
- if there is a storage problem and the update cannot be
executed as requested or if it failed because of a concurrent
update to the same referencepublic org.eclipse.jgit.revwalk.RevCommit commit() throws IOException
IOException
public VersionedMetaData.BatchMetaDataUpdate openUpdate(MetaDataUpdate update) throws IOException
openUpdate
in class VersionedMetaData
IOException
public VersionedMetaData.BatchMetaDataUpdate openUpdate() throws IOException
IOException
protected String getRefName()
getRefName
in class VersionedMetaData
protected boolean onSave(org.eclipse.jgit.lib.CommitBuilder commit)
VersionedMetaData
onSave
in class VersionedMetaData
protected void onLoad() throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
VersionedMetaData
onLoad
in class VersionedMetaData
IOException
org.eclipse.jgit.errors.ConfigInvalidException