|
|
|
@ -75,6 +75,13 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public CommitListAssert nrOfPassingLanes(int lanes) { |
|
|
|
|
assertEquals("Number of passing lanes of commit #" |
|
|
|
|
+ (nextIndex - 1) |
|
|
|
|
+ " not as expected.", lanes, current.passingLanes.length); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public CommitListAssert parents(RevCommit... parents) { |
|
|
|
|
assertEquals("Number of parents of commit #" + (nextIndex - 1) |
|
|
|
|
+ " not as expected.", parents.length, |
|
|
|
@ -308,4 +315,31 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(merge_fix).parents().lanePos(3); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// test a history where a merge commit has two time the same parent
|
|
|
|
|
@Test |
|
|
|
|
public void testDuplicateParents() throws Exception { |
|
|
|
|
final RevCommit m1 = commit(); |
|
|
|
|
final RevCommit m2 = commit(m1); |
|
|
|
|
final RevCommit m3 = commit(m2, m2); |
|
|
|
|
|
|
|
|
|
final RevCommit s1 = commit(m2); |
|
|
|
|
final RevCommit s2 = commit(s1); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
pw.markStart(pw.lookupCommit(m3)); |
|
|
|
|
pw.markStart(pw.lookupCommit(s2)); |
|
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); |
|
|
|
|
pcl.source(pw); |
|
|
|
|
pcl.fillTo(Integer.MAX_VALUE); |
|
|
|
|
|
|
|
|
|
CommitListAssert test = new CommitListAssert(pcl); |
|
|
|
|
test.commit(s2).nrOfPassingLanes(0); |
|
|
|
|
test.commit(s1).nrOfPassingLanes(0); |
|
|
|
|
test.commit(m3).nrOfPassingLanes(1); |
|
|
|
|
test.commit(m2).nrOfPassingLanes(0); |
|
|
|
|
test.commit(m1).nrOfPassingLanes(0); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|