public abstract class AbstractChangeUpdate extends VersionedMetaData
VersionedMetaData.BatchMetaDataUpdate, VersionedMetaData.PathInfo
Modifier and Type | Field and Description |
---|---|
protected String |
anonymousCowardName |
protected ChangeControl |
ctl |
protected NotesMigration |
migration |
protected com.google.gerrit.reviewdb.client.PatchSet.Id |
psId |
protected GitRepositoryManager |
repoManager |
protected org.eclipse.jgit.lib.PersonIdent |
serverIdent |
protected MetaDataUpdate.User |
updateFactory |
protected Date |
when |
inserter, newTree, reader
Modifier and Type | Method and Description |
---|---|
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() |
ChangeNotes |
getChangeNotes() |
com.google.gerrit.reviewdb.client.PatchSet.Id |
getPatchSetId() |
protected abstract com.google.gerrit.reviewdb.client.Project.NameKey |
getProjectName() |
IdentifiedUser |
getUser() |
Date |
getWhen() |
protected org.eclipse.jgit.lib.PersonIdent |
newIdent(com.google.gerrit.reviewdb.client.Account author,
Date when) |
protected void |
onLoad()
Set up the metadata, parsing any state from the loaded revision.
|
VersionedMetaData.BatchMetaDataUpdate |
openUpdate() |
VersionedMetaData.BatchMetaDataUpdate |
openUpdate(MetaDataUpdate update)
Open a batch of updates to the same metadata ref.
|
VersionedMetaData.BatchMetaDataUpdate |
openUpdateInBatch(org.eclipse.jgit.lib.BatchRefUpdate bru) |
void |
setInserter(org.eclipse.jgit.lib.ObjectInserter inserter) |
void |
setPatchSetId(com.google.gerrit.reviewdb.client.PatchSet.Id psId) |
abstract void |
writeCommit(VersionedMetaData.BatchMetaDataUpdate batch)
Writes commit to a BatchMetaDataUpdate without committing the batch.
|
commitToNewRef, getObjectId, getPathInfos, getRefName, getRevision, load, load, load, load, onSave, readConfig, readFile, readTree, readUTF8, saveConfig, saveFile, saveUTF8, set, set, set
protected final NotesMigration migration
protected final GitRepositoryManager repoManager
protected final MetaDataUpdate.User updateFactory
protected final ChangeControl ctl
protected final String anonymousCowardName
protected final org.eclipse.jgit.lib.PersonIdent serverIdent
protected final Date when
protected com.google.gerrit.reviewdb.client.PatchSet.Id psId
public ChangeNotes getChangeNotes()
public com.google.gerrit.reviewdb.client.Change getChange()
public Date getWhen()
public IdentifiedUser getUser()
public com.google.gerrit.reviewdb.client.PatchSet.Id getPatchSetId()
public void setPatchSetId(com.google.gerrit.reviewdb.client.PatchSet.Id psId)
public void setInserter(org.eclipse.jgit.lib.ObjectInserter inserter)
public VersionedMetaData.BatchMetaDataUpdate openUpdate(MetaDataUpdate update) throws IOException
VersionedMetaData
This allows making multiple commits to a single metadata ref, at the end of
which is a single ref update. For batching together updates to multiple
refs (each consisting of one or more commits against their respective
refs), create the MetaDataUpdate
with a BatchRefUpdate
.
A ref update produced by this VersionedMetaData.BatchMetaDataUpdate
is only committed
if there is no associated BatchRefUpdate
. As a result, the
configured ref updated event is not fired if there is an associated batch.
openUpdate
in class VersionedMetaData
update
- helper info about the update.IOException
- if the update failed.public VersionedMetaData.BatchMetaDataUpdate openUpdate() throws IOException
IOException
public VersionedMetaData.BatchMetaDataUpdate openUpdateInBatch(org.eclipse.jgit.lib.BatchRefUpdate bru) throws IOException
IOException
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 referenceprotected void onLoad() throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
VersionedMetaData
onLoad
in class VersionedMetaData
IOException
org.eclipse.jgit.errors.ConfigInvalidException
protected org.eclipse.jgit.lib.PersonIdent newIdent(com.google.gerrit.reviewdb.client.Account author, Date when)
public abstract void writeCommit(VersionedMetaData.BatchMetaDataUpdate batch) throws com.google.gwtorm.server.OrmException, IOException
com.google.gwtorm.server.OrmException
IOException
protected abstract com.google.gerrit.reviewdb.client.Project.NameKey getProjectName()