public class ChangeUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
bumpRowVersionNotLastUpdatedOn(com.google.gerrit.reviewdb.client.Change.Id id,
com.google.gerrit.reviewdb.server.ReviewDb db) |
static java.lang.String |
cropSubject(java.lang.String subject) |
void |
deleteDraftChange(com.google.gerrit.reviewdb.client.Change change) |
void |
deleteOnlyDraftPatchSet(com.google.gerrit.reviewdb.client.PatchSet patch,
com.google.gerrit.reviewdb.client.Change change) |
com.google.gerrit.reviewdb.client.Change.Id |
editCommitMessage(ChangeControl ctl,
com.google.gerrit.reviewdb.client.PatchSet ps,
java.lang.String message,
org.eclipse.jgit.lib.PersonIdent myIdent) |
java.util.List<com.google.gerrit.reviewdb.client.Change> |
findChanges(java.lang.String id)
Find changes matching the given identifier.
|
java.lang.String |
getMessage(com.google.gerrit.reviewdb.client.Change change) |
static void |
insertAncestors(com.google.gerrit.reviewdb.server.ReviewDb db,
com.google.gerrit.reviewdb.client.PatchSet.Id id,
org.eclipse.jgit.revwalk.RevCommit src) |
static java.lang.String |
messageUUID(com.google.gerrit.reviewdb.server.ReviewDb db)
Generate a new unique identifier for change message entities.
|
static com.google.gerrit.reviewdb.client.PatchSet.Id |
nextPatchSetId(java.util.Map<java.lang.String,org.eclipse.jgit.lib.Ref> allRefs,
com.google.gerrit.reviewdb.client.PatchSet.Id id) |
static com.google.gerrit.reviewdb.client.PatchSet.Id |
nextPatchSetId(com.google.gerrit.reviewdb.client.PatchSet.Id id) |
static com.google.gerrit.reviewdb.client.PatchSet.Id |
nextPatchSetId(org.eclipse.jgit.lib.Repository git,
com.google.gerrit.reviewdb.client.PatchSet.Id id) |
com.google.gerrit.reviewdb.client.Change.Id |
revert(ChangeControl ctl,
com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId,
java.lang.String message,
org.eclipse.jgit.lib.PersonIdent myIdent,
SshInfo sshInfo) |
static void |
touch(com.google.gerrit.reviewdb.client.Change change,
com.google.gerrit.reviewdb.server.ReviewDb db) |
static void |
updated(com.google.gerrit.reviewdb.client.Change c) |
public static java.lang.String messageUUID(com.google.gerrit.reviewdb.server.ReviewDb db) throws com.google.gwtorm.server.OrmException
db
- the database connection, used to increment the change message
allocation sequence.com.google.gwtorm.server.OrmException
- the database couldn't be incremented.public static void touch(com.google.gerrit.reviewdb.client.Change change, com.google.gerrit.reviewdb.server.ReviewDb db) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public static void bumpRowVersionNotLastUpdatedOn(com.google.gerrit.reviewdb.client.Change.Id id, com.google.gerrit.reviewdb.server.ReviewDb db) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public static void updated(com.google.gerrit.reviewdb.client.Change c)
public static void insertAncestors(com.google.gerrit.reviewdb.server.ReviewDb db, com.google.gerrit.reviewdb.client.PatchSet.Id id, org.eclipse.jgit.revwalk.RevCommit src) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public static com.google.gerrit.reviewdb.client.PatchSet.Id nextPatchSetId(java.util.Map<java.lang.String,org.eclipse.jgit.lib.Ref> allRefs, com.google.gerrit.reviewdb.client.PatchSet.Id id)
public static com.google.gerrit.reviewdb.client.PatchSet.Id nextPatchSetId(org.eclipse.jgit.lib.Repository git, com.google.gerrit.reviewdb.client.PatchSet.Id id) throws java.io.IOException
java.io.IOException
public static java.lang.String cropSubject(java.lang.String subject)
public com.google.gerrit.reviewdb.client.Change.Id revert(ChangeControl ctl, com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId, java.lang.String message, org.eclipse.jgit.lib.PersonIdent myIdent, SshInfo sshInfo) throws NoSuchChangeException, com.google.gwtorm.server.OrmException, org.eclipse.jgit.errors.MissingObjectException, org.eclipse.jgit.errors.IncorrectObjectTypeException, java.io.IOException, InvalidChangeOperationException
NoSuchChangeException
com.google.gwtorm.server.OrmException
org.eclipse.jgit.errors.MissingObjectException
org.eclipse.jgit.errors.IncorrectObjectTypeException
java.io.IOException
InvalidChangeOperationException
public com.google.gerrit.reviewdb.client.Change.Id editCommitMessage(ChangeControl ctl, com.google.gerrit.reviewdb.client.PatchSet ps, java.lang.String message, org.eclipse.jgit.lib.PersonIdent myIdent) throws NoSuchChangeException, com.google.gwtorm.server.OrmException, org.eclipse.jgit.errors.MissingObjectException, org.eclipse.jgit.errors.IncorrectObjectTypeException, java.io.IOException, InvalidChangeOperationException
NoSuchChangeException
com.google.gwtorm.server.OrmException
org.eclipse.jgit.errors.MissingObjectException
org.eclipse.jgit.errors.IncorrectObjectTypeException
java.io.IOException
InvalidChangeOperationException
public java.lang.String getMessage(com.google.gerrit.reviewdb.client.Change change) throws NoSuchChangeException, com.google.gwtorm.server.OrmException, org.eclipse.jgit.errors.MissingObjectException, org.eclipse.jgit.errors.IncorrectObjectTypeException, java.io.IOException
NoSuchChangeException
com.google.gwtorm.server.OrmException
org.eclipse.jgit.errors.MissingObjectException
org.eclipse.jgit.errors.IncorrectObjectTypeException
java.io.IOException
public void deleteDraftChange(com.google.gerrit.reviewdb.client.Change change) throws NoSuchChangeException, com.google.gwtorm.server.OrmException, java.io.IOException
NoSuchChangeException
com.google.gwtorm.server.OrmException
java.io.IOException
public void deleteOnlyDraftPatchSet(com.google.gerrit.reviewdb.client.PatchSet patch, com.google.gerrit.reviewdb.client.Change change) throws NoSuchChangeException, com.google.gwtorm.server.OrmException, java.io.IOException
NoSuchChangeException
com.google.gwtorm.server.OrmException
java.io.IOException
public java.util.List<com.google.gerrit.reviewdb.client.Change> findChanges(java.lang.String id) throws com.google.gwtorm.server.OrmException, com.google.gerrit.extensions.restapi.ResourceNotFoundException
id
- change identifier, either a numeric ID, a Change-Id, or
project~branch~id triplet.com.google.gwtorm.server.OrmException
com.google.gerrit.extensions.restapi.ResourceNotFoundException
public static com.google.gerrit.reviewdb.client.PatchSet.Id nextPatchSetId(com.google.gerrit.reviewdb.client.PatchSet.Id id)