WalkSorter: Don't topo sort

Topo sorting slurps all interesting commits when the walk starts, and
the nature of this operation means we aren't marking any commits as
uninteresting. This makes WalkSorter far too slow for large
repositories; the default sort will have to be good enough.

Change-Id: I7d5b7e47aae10963a9787defd0067b68d7147b85
This commit is contained in:
Dave Borowitz
2015-06-04 12:43:41 -07:00
parent c6132e6b81
commit 3dd0f4cad9
2 changed files with 11 additions and 5 deletions

View File

@@ -115,12 +115,16 @@ public class WalkSorterTest {
List<ChangeData> changes = ImmutableList.of(cd1, cd2, cd3, cd4);
WalkSorter sorter = new WalkSorter(repoManager);
assertSorted(sorter, changes, ImmutableList.of(
List<PatchSetData> expected = ImmutableList.of(
patchSetData(cd4, c4),
patchSetData(cd3, c3),
patchSetData(cd2, c2),
patchSetData(cd1, c1)));
patchSetData(cd1, c1));
for (List<ChangeData> list : permutations(changes)) {
// Not inOrder(); default sort can't distinguish between these.
assertThat(sorter.sort(list)).containsExactlyElementsIn(expected);
}
}
@Test