public interface ChangeContext extends Context
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.
Modifier and Type | Method and Description |
---|---|
void |
deleteChange()
Instruct
BatchUpdate to delete this change. |
void |
dontBumpLastUpdatedOn()
Don't bump the value of
Change.getLastUpdatedOn() . |
default Change |
getChange() |
ChangeNotes |
getNotes()
Get the up-to-date notes for this change.
|
ChangeUpdate |
getUpdate(PatchSet.Id psId)
Get an update for this change at a given patch set.
|
getAccount, getAccountId, getDb, getIdentifiedUser, getOrder, getProject, getRepoView, getRevWalk, getTimeZone, getUser, getWhen
ChangeUpdate getUpdate(PatchSet.Id psId)
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.reviewdb.server.ReviewDb, com.google.gerrit.server.notedb.ChangeNotes)
.
psId
- patch set ID.ChangeNotes getNotes()
The change data is read within the same transaction that BatchUpdateOp.updateChange(ChangeContext)
is executing.
void dontBumpLastUpdatedOn()
Change.getLastUpdatedOn()
.
If called, don't bump the timestamp before storing to ReviewDb. Only has an effect in ReviewDb, and the only usage should be to match the behavior of NoteDb. Specifically, in NoteDb the timestamp is updated if and only if the change meta graph is updated, and is not updated when only drafts are modified.
void deleteChange()
BatchUpdate
to delete this change.
If called, all other updates are ignored.
default Change getChange()
getNotes()
.