Package com.google.gerrit.server
Class PatchSetUtil
- java.lang.Object
-
- com.google.gerrit.server.PatchSetUtil
-
public class PatchSetUtil extends Object
Utilities for manipulating patch sets.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableCollection<PatchSet>
byChange(ReviewDb db, ChangeNotes notes)
com.google.common.collect.ImmutableMap<PatchSet.Id,PatchSet>
byChangeAsMap(ReviewDb db, ChangeNotes notes)
void
checkPatchSetNotLocked(ChangeNotes notes)
Check if the current patch set of the change is locked.PatchSet
current(ReviewDb db, ChangeNotes notes)
PatchSet
get(ReviewDb db, ChangeNotes notes, PatchSet.Id psId)
com.google.common.collect.ImmutableMap<PatchSet.Id,PatchSet>
getAsMap(ReviewDb db, ChangeNotes notes, Set<PatchSet.Id> patchSetIds)
org.eclipse.jgit.revwalk.RevCommit
getRevCommit(Project.NameKey project, PatchSet patchSet)
Returns the commit for the given project at the given patchset revisionPatchSet
insert(ReviewDb db, org.eclipse.jgit.revwalk.RevWalk rw, ChangeUpdate update, PatchSet.Id psId, org.eclipse.jgit.lib.ObjectId commit, List<String> groups, String pushCertificate, String description)
boolean
isPatchSetLocked(ChangeNotes notes)
Is the current patch set locked against state changes?void
publish(ReviewDb db, ChangeUpdate update, PatchSet ps)
void
setGroups(ReviewDb db, ChangeUpdate update, PatchSet ps, List<String> groups)
-
-
-
Method Detail
-
current
public PatchSet current(ReviewDb db, ChangeNotes notes) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
get
public PatchSet get(ReviewDb db, ChangeNotes notes, PatchSet.Id psId) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
byChange
public com.google.common.collect.ImmutableCollection<PatchSet> byChange(ReviewDb db, ChangeNotes notes) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
byChangeAsMap
public com.google.common.collect.ImmutableMap<PatchSet.Id,PatchSet> byChangeAsMap(ReviewDb db, ChangeNotes notes) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
getAsMap
public com.google.common.collect.ImmutableMap<PatchSet.Id,PatchSet> getAsMap(ReviewDb db, ChangeNotes notes, Set<PatchSet.Id> patchSetIds) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
insert
public PatchSet insert(ReviewDb db, 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 com.google.gwtorm.server.OrmException, IOException
- Throws:
com.google.gwtorm.server.OrmException
IOException
-
publish
public void publish(ReviewDb db, ChangeUpdate update, PatchSet ps) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
setGroups
public void setGroups(ReviewDb db, ChangeUpdate update, PatchSet ps, List<String> groups) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
checkPatchSetNotLocked
public void checkPatchSetNotLocked(ChangeNotes notes) throws com.google.gwtorm.server.OrmException, IOException, ResourceConflictException
Check if the current patch set of the change is locked.- Throws:
com.google.gwtorm.server.OrmException
IOException
ResourceConflictException
-
isPatchSetLocked
public boolean isPatchSetLocked(ChangeNotes notes) throws com.google.gwtorm.server.OrmException, IOException
Is the current patch set locked against state changes?- Throws:
com.google.gwtorm.server.OrmException
IOException
-
getRevCommit
public 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
-
-