public class ChangeUtil extends Object
Modifier and Type | Field and Description |
---|---|
static com.google.common.collect.Ordering<com.google.gerrit.reviewdb.client.PatchSet> |
PS_ID_ORDER |
static com.google.common.base.Function<com.google.gerrit.reviewdb.client.PatchSet,Integer> |
TO_PS_ID |
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 String |
cropSubject(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) |
List<com.google.gerrit.reviewdb.client.Change> |
findChanges(String id)
Find changes matching the given identifier.
|
String |
getMessage(com.google.gerrit.reviewdb.client.Change change) |
static 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(Map<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,
String message,
org.eclipse.jgit.lib.PersonIdent myIdent) |
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 final com.google.common.base.Function<com.google.gerrit.reviewdb.client.PatchSet,Integer> TO_PS_ID
public static final com.google.common.collect.Ordering<com.google.gerrit.reviewdb.client.PatchSet> PS_ID_ORDER
public static 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 com.google.gerrit.reviewdb.client.PatchSet.Id nextPatchSetId(Map<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 IOException
IOException
public com.google.gerrit.reviewdb.client.Change.Id revert(ChangeControl ctl, com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId, 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, IOException, com.google.gerrit.extensions.restapi.RestApiException, UpdateException
NoSuchChangeException
com.google.gwtorm.server.OrmException
org.eclipse.jgit.errors.MissingObjectException
org.eclipse.jgit.errors.IncorrectObjectTypeException
IOException
com.google.gerrit.extensions.restapi.RestApiException
UpdateException
public 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, IOException
NoSuchChangeException
com.google.gwtorm.server.OrmException
org.eclipse.jgit.errors.MissingObjectException
org.eclipse.jgit.errors.IncorrectObjectTypeException
IOException
public void deleteDraftChange(com.google.gerrit.reviewdb.client.Change change) throws NoSuchChangeException, com.google.gwtorm.server.OrmException, IOException
NoSuchChangeException
com.google.gwtorm.server.OrmException
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, IOException
NoSuchChangeException
com.google.gwtorm.server.OrmException
IOException
public List<com.google.gerrit.reviewdb.client.Change> findChanges(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)