|
|
|
@ -135,7 +135,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit b = commit(a); |
|
|
|
|
final RevCommit c = commit(b); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(c.getId())); |
|
|
|
|
|
|
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
@ -148,6 +148,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(a).lanePos(0).parents(); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testMerged() throws Exception { |
|
|
|
@ -156,7 +157,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit c = commit(a); |
|
|
|
|
final RevCommit d = commit(b, c); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(d.getId())); |
|
|
|
|
|
|
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
@ -170,6 +171,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(a).lanePos(0).parents(); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testSideBranch() throws Exception { |
|
|
|
@ -177,7 +179,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit b = commit(a); |
|
|
|
|
final RevCommit c = commit(a); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(b.getId())); |
|
|
|
|
pw.markStart(pw.lookupCommit(c.getId())); |
|
|
|
|
|
|
|
|
@ -192,6 +194,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(a).lanePos(0).parents(); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void test2SideBranches() throws Exception { |
|
|
|
@ -200,7 +203,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit c = commit(a); |
|
|
|
|
final RevCommit d = commit(a); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(b.getId())); |
|
|
|
|
pw.markStart(pw.lookupCommit(c.getId())); |
|
|
|
|
pw.markStart(pw.lookupCommit(d.getId())); |
|
|
|
@ -217,6 +220,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(a).lanePos(0).parents(); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testBug300282_1() throws Exception { |
|
|
|
@ -228,10 +232,10 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit f = commit(a); |
|
|
|
|
final RevCommit g = commit(f); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
// TODO: when we add unnecessary commit's as tips (e.g. a commit which
|
|
|
|
|
// is a parent of another tip) the walk will return those commits twice.
|
|
|
|
|
// Find out why!
|
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
// TODO: when we add unnecessary commit's as tips (e.g. a commit
|
|
|
|
|
// which is a parent of another tip) the walk will return those
|
|
|
|
|
// commits twice. Find out why!
|
|
|
|
|
// pw.markStart(pw.lookupCommit(a.getId()));
|
|
|
|
|
pw.markStart(pw.lookupCommit(b.getId())); |
|
|
|
|
pw.markStart(pw.lookupCommit(c.getId())); |
|
|
|
@ -257,6 +261,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(a).lanePos(0).parents(); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testBug368927() throws Exception { |
|
|
|
@ -270,7 +275,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit h = commit(f); |
|
|
|
|
final RevCommit i = commit(h); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(i.getId())); |
|
|
|
|
pw.markStart(pw.lookupCommit(g.getId())); |
|
|
|
|
|
|
|
|
@ -290,6 +295,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(b).lanePos(posI).parents(a); |
|
|
|
|
test.commit(a).lanePos(0).parents(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// test the history of the egit project between 9fdaf3c1 and e76ad9170f
|
|
|
|
|
@Test |
|
|
|
@ -330,7 +336,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit merge_fixed_logged_npe = commit(sort_roots, |
|
|
|
|
fix_logged_npe); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(merge_fixed_logged_npe.getId())); |
|
|
|
|
|
|
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
@ -339,19 +345,22 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
|
|
|
|
|
CommitListAssert test = new CommitListAssert(pcl); |
|
|
|
|
|
|
|
|
|
// Note: all positions of side branches are rather arbitrary, but some
|
|
|
|
|
// Note: all positions of side branches are rather arbitrary, but
|
|
|
|
|
// some
|
|
|
|
|
// may not overlap. Testing for the positions yielded by the current
|
|
|
|
|
// implementation, which was manually checked to not overlap.
|
|
|
|
|
final int mainPos = 0; |
|
|
|
|
test.commit(merge_fixed_logged_npe).parents(sort_roots, fix_logged_npe) |
|
|
|
|
.lanePos(mainPos); |
|
|
|
|
test.commit(merge_fixed_logged_npe) |
|
|
|
|
.parents(sort_roots, fix_logged_npe).lanePos(mainPos); |
|
|
|
|
test.commit(fix_logged_npe).parents(merge_changeset_implementation) |
|
|
|
|
.lanePos(1); |
|
|
|
|
test.commit(sort_roots).parents(merge_update_eclipse).lanePos(mainPos); |
|
|
|
|
test.commit(merge_update_eclipse).parents(add_a_clear, update_eclipse) |
|
|
|
|
test.commit(sort_roots).parents(merge_update_eclipse) |
|
|
|
|
.lanePos(mainPos); |
|
|
|
|
test.commit(merge_update_eclipse) |
|
|
|
|
.parents(add_a_clear, update_eclipse).lanePos(mainPos); |
|
|
|
|
test.commit(add_a_clear).parents(fix_broken).lanePos(mainPos); |
|
|
|
|
test.commit(fix_broken).parents(merge_disable_comment).lanePos(mainPos); |
|
|
|
|
test.commit(fix_broken).parents(merge_disable_comment) |
|
|
|
|
.lanePos(mainPos); |
|
|
|
|
test.commit(merge_disable_comment) |
|
|
|
|
.parents(merge_resolve_handler, disable_comment) |
|
|
|
|
.lanePos(mainPos); |
|
|
|
@ -370,8 +379,8 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(update_eclipse_iplog2).parents(merge_use_remote) |
|
|
|
|
.lanePos(mainPos); |
|
|
|
|
test.commit(disable_source).parents(merge_use_remote).lanePos(1); |
|
|
|
|
test.commit(merge_use_remote).parents(update_eclipse_iplog, use_remote) |
|
|
|
|
.lanePos(mainPos); |
|
|
|
|
test.commit(merge_use_remote) |
|
|
|
|
.parents(update_eclipse_iplog, use_remote).lanePos(mainPos); |
|
|
|
|
test.commit(changeset_implementation).parents(clear_repositorycache) |
|
|
|
|
.lanePos(2); |
|
|
|
|
test.commit(update_eclipse_iplog).parents(merge_add_Maven) |
|
|
|
@ -392,6 +401,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(merge_fix).parents().lanePos(mainPos); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// test a history where a merge commit has two time the same parent
|
|
|
|
|
@Test |
|
|
|
@ -403,7 +413,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit s1 = commit(m2); |
|
|
|
|
final RevCommit s2 = commit(s1); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(m3)); |
|
|
|
|
pw.markStart(pw.lookupCommit(s2)); |
|
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
@ -418,6 +428,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(m1).nrOfPassingLanes(0); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The graph shows the problematic original positioning. Due to this some |
|
|
|
@ -465,7 +476,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit a4 = commit(a3); |
|
|
|
|
final RevCommit a5 = commit(a3, a4); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(b3.getId())); |
|
|
|
|
pw.markStart(pw.lookupCommit(c.getId())); |
|
|
|
|
pw.markStart(pw.lookupCommit(e.getId())); |
|
|
|
@ -490,6 +501,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
assertNotEquals("b lane is blocked by d", bPos, |
|
|
|
|
pcl.get(5).lane.position); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <pre> |
|
|
|
@ -517,7 +529,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit a4 = commit(a3, b2); |
|
|
|
|
final RevCommit b3 = commit(b2); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(a4)); |
|
|
|
|
pw.markStart(pw.lookupCommit(b3)); |
|
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
@ -535,6 +547,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(a1).lanePos(posA); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <pre> |
|
|
|
@ -562,7 +575,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit b3 = commit(b2); |
|
|
|
|
final RevCommit a4 = commit(a3); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(a4)); |
|
|
|
|
pw.markStart(pw.lookupCommit(b3)); |
|
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
@ -582,6 +595,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(a1).lanePos(posA); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <pre> |
|
|
|
@ -611,7 +625,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit a4 = commit(a3, b1); |
|
|
|
|
final RevCommit b2 = commit(b1); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(a4)); |
|
|
|
|
pw.markStart(pw.lookupCommit(b2)); |
|
|
|
|
pw.markStart(pw.lookupCommit(c)); |
|
|
|
@ -630,6 +644,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(a1).lanePos(posA); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <pre> |
|
|
|
@ -651,7 +666,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit a3 = commit(a2); |
|
|
|
|
final RevCommit b1 = commit(a1); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(a3)); |
|
|
|
|
pw.markStart(pw.lookupCommit(b1)); |
|
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
@ -660,7 +675,8 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
|
|
|
|
|
Set<Integer> positions = asSet(0, 1); |
|
|
|
|
CommitListAssert test = new CommitListAssert(pcl); |
|
|
|
|
PlotLane laneB = test.commit(b1).lanePos(positions).current.getLane(); |
|
|
|
|
PlotLane laneB = test.commit(b1).lanePos(positions).current |
|
|
|
|
.getLane(); |
|
|
|
|
int posA = test.commit(a3).lanePos(positions).getLanePos(); |
|
|
|
|
test.commit(a2).lanePos(posA); |
|
|
|
|
assertArrayEquals( |
|
|
|
@ -668,13 +684,14 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
new PlotLane[] { laneB }, test.current.passingLanes); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testTwoRoots1() throws Exception { |
|
|
|
|
final RevCommit a = commit(); |
|
|
|
|
final RevCommit b = commit(); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(a)); |
|
|
|
|
pw.markStart(pw.lookupCommit(b)); |
|
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
@ -686,6 +703,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.commit(a).lanePos(0); |
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testTwoRoots2() throws Exception { |
|
|
|
@ -693,7 +711,7 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
final RevCommit b1 = commit(); |
|
|
|
|
final RevCommit b2 = commit(b1); |
|
|
|
|
|
|
|
|
|
PlotWalk pw = new PlotWalk(db); |
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
|
pw.markStart(pw.lookupCommit(a)); |
|
|
|
|
pw.markStart(pw.lookupCommit(b2)); |
|
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
@ -707,3 +725,4 @@ public class PlotCommitListTest extends RevWalkTestCase {
|
|
|
|
|
test.noMoreCommits(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|