Package com.google.gerrit.server.change
Class WalkSorter
- java.lang.Object
-
- com.google.gerrit.server.change.WalkSorter
-
public class WalkSorter extends Object
Helper to sortChangeData
s based onRevWalk
ordering.Split changes by project, and map each change to a single commit based on the latest patch set. The set of patch sets considered may be limited by calling
includePatchSets(Iterable)
. Perform a standardRevWalk
on each project repository, do an approximate topo sort, and record the order in which each change's commit is seen.Once an order within each project is determined, groups of changes are sorted based on the project name. This is slightly more stable than sorting on something like the commit or change timestamp, as it will not unexpectedly reorder large groups of changes on subsequent calls if one of the changes was updated.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WalkSorter.PatchSetData
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WalkSorter
includePatchSets(Iterable<PatchSet.Id> patchSets)
WalkSorter
setRetainBody(boolean retainBody)
Iterable<WalkSorter.PatchSetData>
sort(Iterable<ChangeData> in)
-
-
-
Method Detail
-
includePatchSets
public WalkSorter includePatchSets(Iterable<PatchSet.Id> patchSets)
-
setRetainBody
public WalkSorter setRetainBody(boolean retainBody)
-
sort
public Iterable<WalkSorter.PatchSetData> sort(Iterable<ChangeData> in) throws IOException
- Throws:
IOException
-
-