public class ChangeUtil extends Object
Modifier and Type | Field and Description |
---|---|
static com.google.common.collect.Ordering<PatchSet> |
PS_ID_ORDER |
static int |
TOPIC_MAX_LENGTH |
Modifier and Type | Method and Description |
---|---|
static String |
messageUuid() |
static PatchSet.Id |
nextPatchSetId(PatchSet.Id id)
Get the next patch set ID just looking at a single previous patch set ID.
|
static PatchSet.Id |
nextPatchSetId(org.eclipse.jgit.lib.Repository git,
PatchSet.Id id)
Get the next patch set ID from scanning refs in the repo.
|
static PatchSet.Id |
nextPatchSetIdFromAllRefsMap(Map<String,org.eclipse.jgit.lib.Ref> allRefs,
PatchSet.Id id)
Get the next patch set ID from a previously-read map of all refs.
|
static PatchSet.Id |
nextPatchSetIdFromChangeRefsMap(Map<String,org.eclipse.jgit.lib.ObjectId> changeRefs,
PatchSet.Id id)
Get the next patch set ID from a previously-read map of refs below the change prefix.
|
static String |
status(Change c) |
public static final int TOPIC_MAX_LENGTH
public static final com.google.common.collect.Ordering<PatchSet> PS_ID_ORDER
public static String messageUuid()
public static PatchSet.Id nextPatchSetIdFromAllRefsMap(Map<String,org.eclipse.jgit.lib.Ref> allRefs, PatchSet.Id id)
allRefs
- map of full ref name to ref.id
- previous patch set ID.allRefs
map.public static PatchSet.Id nextPatchSetIdFromChangeRefsMap(Map<String,org.eclipse.jgit.lib.ObjectId> changeRefs, PatchSet.Id id)
changeRefs
- map of ref suffix to SHA-1, where the keys are ref names with the refs/changes/CD/ABCD/
prefix stripped. All refs should be under id
's change ref
prefix.id
- previous patch set ID.changeRefs
map.public static PatchSet.Id nextPatchSetId(PatchSet.Id id)
This patch set ID may or may not be available in the database; callers that want a
previously-unused ID should use nextPatchSetIdFromAllRefsMap(java.util.Map<java.lang.String, org.eclipse.jgit.lib.Ref>, com.google.gerrit.reviewdb.client.PatchSet.Id)
or nextPatchSetIdFromChangeRefsMap(java.util.Map<java.lang.String, org.eclipse.jgit.lib.ObjectId>, com.google.gerrit.reviewdb.client.PatchSet.Id)
.
id
- previous patch set ID.public static PatchSet.Id nextPatchSetId(org.eclipse.jgit.lib.Repository git, PatchSet.Id id) throws IOException
git
- repository to scan for patch set refs.id
- previous patch set ID.IOException