Package com.google.gerrit.server.update
Interface ChangeContext
- All Superinterfaces:
Context
Context for performing the
BatchUpdateOp.updateChange(com.google.gerrit.server.update.ChangeContext)
phase.
A single ChangeContext
corresponds to updating a single change; if a BatchUpdate
spans multiple changes, then multiple ChangeContext
instances will be
created.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
InstructBatchUpdate
to delete this change.default Change
Returns change corresponding togetNotes()
.getDistinctUpdate
(PatchSet.Id psId) Gets a new ChangeUpdate for this change at a given patch set.getNotes()
Get the up-to-date notes for this change.getUpdate
(PatchSet.Id psId) Get the first update for this change at a given patch set.Methods inherited from interface com.google.gerrit.server.update.Context
getAccount, getAccountId, getIdentifiedUser, getNotify, getProject, getRepoView, getRevWalk, getUser, getWhen, getZoneId, newCommitterIdent, newCommitterIdent, newCommitterIdent, newPersonIdent
-
Method Details
-
getUpdate
Get the first update for this change at a given patch set.A single operation can modify changes at different patch sets. Commits in the NoteDb graph within this update are created in patch set order.
To get the current patch set ID, use
PatchSetUtil.current(com.google.gerrit.server.notedb.ChangeNotes)
.- Parameters:
psId
- patch set ID.- Returns:
- handle for change updates.
-
getDistinctUpdate
Gets a new ChangeUpdate for this change at a given patch set.To get the current patch set ID, use
PatchSetUtil.current(com.google.gerrit.server.notedb.ChangeNotes)
.- Parameters:
psId
- patch set ID.- Returns:
- handle for change updates.
-
getNotes
ChangeNotes getNotes()Get the up-to-date notes for this change.The change data is read within the same transaction that
BatchUpdateOp.updateChange(ChangeContext)
is executing.- Returns:
- notes for this change.
-
deleteChange
void deleteChange()InstructBatchUpdate
to delete this change.If called, all other updates are ignored.
-
getChange
Returns change corresponding togetNotes()
.
-