Package com.google.gerrit.server
Class PatchSetUtil
java.lang.Object
com.google.gerrit.server.PatchSetUtil
Utilities for manipulating patch sets.
- 
Method SummaryModifier and TypeMethodDescriptioncom.google.common.collect.ImmutableCollection<PatchSet>byChange(ChangeNotes notes) com.google.common.collect.ImmutableMap<PatchSet.Id,PatchSet> byChangeAsMap(ChangeNotes notes) voidCheck if the current patch set of the change is locked.current(ChangeNotes notes) get(ChangeNotes notes, PatchSet.Id psId) com.google.common.collect.ImmutableMap<PatchSet.Id,PatchSet> getAsMap(ChangeNotes notes, Set<PatchSet.Id> patchSetIds) static org.eclipse.jgit.revwalk.RevCommitgetCurrentCommittedRevCommit(Project.NameKey project, org.eclipse.jgit.revwalk.RevWalk revWalk, ChangeNotes.Factory notesFactory, Change.Id changeId) Gets the commit ID for the latest committed patch-set of a given change.static org.eclipse.jgit.revwalk.RevCommitgetCurrentRevCommitIncludingPending(RepoContext ctx, ChangeNotes.Factory notesFactory, Change.Id changeId) Gets the commit ID for the latest patch-set of a given change.org.eclipse.jgit.revwalk.RevCommitgetRevCommit(Project.NameKey project, PatchSet patchSet) Returns the commit for the given project at the given patchset revisioninsert(org.eclipse.jgit.revwalk.RevWalk rw, ChangeUpdate update, PatchSet.Id psId, org.eclipse.jgit.lib.ObjectId commit, List<String> groups, String pushCertificate, String description) booleanisPatchSetLocked(ChangeNotes notes) Is the current patch set locked against state changes?
- 
Method Details- 
current
- 
get
- 
byChange
- 
byChangeAsMappublic com.google.common.collect.ImmutableMap<PatchSet.Id,PatchSet> byChangeAsMap(ChangeNotes notes) 
- 
getAsMappublic com.google.common.collect.ImmutableMap<PatchSet.Id,PatchSet> getAsMap(ChangeNotes notes, Set<PatchSet.Id> patchSetIds) 
- 
insertpublic PatchSet insert(org.eclipse.jgit.revwalk.RevWalk rw, ChangeUpdate update, PatchSet.Id psId, org.eclipse.jgit.lib.ObjectId commit, List<String> groups, String pushCertificate, String description) throws IOException - Throws:
- IOException
 
- 
checkPatchSetNotLockedCheck if the current patch set of the change is locked.- Throws:
- ResourceConflictException
 
- 
isPatchSetLockedIs the current patch set locked against state changes?
- 
getRevCommitpublic org.eclipse.jgit.revwalk.RevCommit getRevCommit(Project.NameKey project, PatchSet patchSet) throws IOException Returns the commit for the given project at the given patchset revision- Throws:
- IOException
 
- 
getCurrentRevCommitIncludingPendingpublic static org.eclipse.jgit.revwalk.RevCommit getCurrentRevCommitIncludingPending(RepoContext ctx, ChangeNotes.Factory notesFactory, Change.Id changeId) throws IOException Gets the commit ID for the latest patch-set of a given change.This also takes into account the patch sets that are added in the provided RepoContext.- Parameters:
- ctx- to look for pending updates in.
- notesFactory- to fetch existing patch sets with.
- changeId- to get the latest commit for.
- Returns:
- the latest commit ID.
- Throws:
- IOException- if no committed nor pending commits found for the change.
 
- 
getCurrentCommittedRevCommitpublic static org.eclipse.jgit.revwalk.RevCommit getCurrentCommittedRevCommit(Project.NameKey project, org.eclipse.jgit.revwalk.RevWalk revWalk, ChangeNotes.Factory notesFactory, Change.Id changeId) throws IOException Gets the commit ID for the latest committed patch-set of a given change.This DOES NOT take into account the patch sets that are added in the provided RepoContext.- Parameters:
- project- name.
- notesFactory- to fetch existing patch sets with.
- changeId- to get the latest commit for.
- Returns:
- the latest commit ID.
- Throws:
- IOException- if no committed commits found for the change.
 
 
-