|
|
@ -254,12 +254,12 @@ public class PlotCommitListTest extends RevWalkTestCase { |
|
|
|
int posI = test.commit(i).lanePos(childPositions).parents(h) |
|
|
|
int posI = test.commit(i).lanePos(childPositions).parents(h) |
|
|
|
.getLanePos(); |
|
|
|
.getLanePos(); |
|
|
|
test.commit(h).lanePos(posI).parents(f); |
|
|
|
test.commit(h).lanePos(posI).parents(f); |
|
|
|
|
|
|
|
test.commit(g).lanePos(childPositions).parents(a); |
|
|
|
test.commit(f).lanePos(posI).parents(e, d); |
|
|
|
test.commit(f).lanePos(posI).parents(e, d); |
|
|
|
test.commit(d).lanePos(1).parents(b); |
|
|
|
|
|
|
|
test.commit(e).lanePos(posI).parents(c); |
|
|
|
test.commit(e).lanePos(posI).parents(c); |
|
|
|
|
|
|
|
test.commit(d).lanePos(2).parents(b); |
|
|
|
test.commit(c).lanePos(posI).parents(b); |
|
|
|
test.commit(c).lanePos(posI).parents(b); |
|
|
|
test.commit(b).lanePos(posI).parents(a); |
|
|
|
test.commit(b).lanePos(posI).parents(a); |
|
|
|
test.commit(g).lanePos(childPositions).parents(a); |
|
|
|
|
|
|
|
test.commit(a).lanePos(0).parents(); |
|
|
|
test.commit(a).lanePos(0).parents(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -325,42 +325,42 @@ public class PlotCommitListTest extends RevWalkTestCase { |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
test.commit(merge_update_eclipse) |
|
|
|
test.commit(merge_update_eclipse) |
|
|
|
.parents(add_a_clear, update_eclipse).lanePos(mainPos); |
|
|
|
.parents(add_a_clear, update_eclipse).lanePos(mainPos); |
|
|
|
test.commit(update_eclipse).parents(add_Maven).lanePos(2); |
|
|
|
|
|
|
|
test.commit(add_a_clear).parents(fix_broken).lanePos(mainPos); |
|
|
|
test.commit(add_a_clear).parents(fix_broken).lanePos(mainPos); |
|
|
|
test.commit(fix_broken).parents(merge_disable_comment) |
|
|
|
test.commit(fix_broken).parents(merge_disable_comment) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
test.commit(merge_disable_comment) |
|
|
|
test.commit(merge_disable_comment) |
|
|
|
.parents(merge_resolve_handler, disable_comment) |
|
|
|
.parents(merge_resolve_handler, disable_comment) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
test.commit(disable_comment).parents(clone_operation).lanePos(3); |
|
|
|
test.commit(disable_comment).parents(clone_operation).lanePos(2); |
|
|
|
test.commit(merge_resolve_handler) |
|
|
|
test.commit(merge_resolve_handler) |
|
|
|
.parents(clone_operation, resolve_handler).lanePos(mainPos); |
|
|
|
.parents(clone_operation, resolve_handler).lanePos(mainPos); |
|
|
|
test.commit(resolve_handler).parents(merge_fix).lanePos(4); |
|
|
|
test.commit(update_eclipse).parents(add_Maven).lanePos(3); |
|
|
|
test.commit(clone_operation).parents(merge_changeset_implementation) |
|
|
|
test.commit(clone_operation).parents(merge_changeset_implementation) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
test.commit(merge_changeset_implementation) |
|
|
|
test.commit(merge_changeset_implementation) |
|
|
|
.parents(merge_disable_source, changeset_implementation) |
|
|
|
.parents(merge_disable_source, changeset_implementation) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
test.commit(changeset_implementation).parents(clear_repositorycache) |
|
|
|
|
|
|
|
.lanePos(1); |
|
|
|
|
|
|
|
test.commit(merge_disable_source) |
|
|
|
test.commit(merge_disable_source) |
|
|
|
.parents(update_eclipse_iplog2, disable_source) |
|
|
|
.parents(update_eclipse_iplog2, disable_source) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
test.commit(disable_source).parents(merge_use_remote).lanePos(3); |
|
|
|
|
|
|
|
test.commit(update_eclipse_iplog2).parents(merge_use_remote) |
|
|
|
test.commit(update_eclipse_iplog2).parents(merge_use_remote) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
|
|
|
|
test.commit(disable_source).parents(merge_use_remote).lanePos(1); |
|
|
|
test.commit(merge_use_remote) |
|
|
|
test.commit(merge_use_remote) |
|
|
|
.parents(update_eclipse_iplog, use_remote).lanePos(mainPos); |
|
|
|
.parents(update_eclipse_iplog, use_remote).lanePos(mainPos); |
|
|
|
test.commit(use_remote).parents(clear_repositorycache).lanePos(3); |
|
|
|
test.commit(changeset_implementation).parents(clear_repositorycache) |
|
|
|
|
|
|
|
.lanePos(2); |
|
|
|
test.commit(update_eclipse_iplog).parents(merge_add_Maven) |
|
|
|
test.commit(update_eclipse_iplog).parents(merge_add_Maven) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
test.commit(merge_add_Maven).parents(findToolBar_layout, add_Maven) |
|
|
|
test.commit(merge_add_Maven).parents(findToolBar_layout, add_Maven) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
test.commit(add_Maven).parents(clear_repositorycache).lanePos(2); |
|
|
|
|
|
|
|
test.commit(findToolBar_layout).parents(clear_repositorycache) |
|
|
|
test.commit(findToolBar_layout).parents(clear_repositorycache) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
|
|
|
|
test.commit(use_remote).parents(clear_repositorycache).lanePos(1); |
|
|
|
|
|
|
|
test.commit(add_Maven).parents(clear_repositorycache).lanePos(3); |
|
|
|
test.commit(clear_repositorycache).parents(merge_remove) |
|
|
|
test.commit(clear_repositorycache).parents(merge_remove) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
|
|
|
|
test.commit(resolve_handler).parents(merge_fix).lanePos(4); |
|
|
|
test.commit(merge_remove).parents(add_simple, remove_unused) |
|
|
|
test.commit(merge_remove).parents(add_simple, remove_unused) |
|
|
|
.lanePos(mainPos); |
|
|
|
.lanePos(mainPos); |
|
|
|
test.commit(remove_unused).parents(merge_fix).lanePos(1); |
|
|
|
test.commit(remove_unused).parents(merge_fix).lanePos(1); |
|
|
@ -453,36 +453,33 @@ public class PlotCommitListTest extends RevWalkTestCase { |
|
|
|
pcl.source(pw); |
|
|
|
pcl.source(pw); |
|
|
|
pcl.fillTo(Integer.MAX_VALUE); |
|
|
|
pcl.fillTo(Integer.MAX_VALUE); |
|
|
|
|
|
|
|
|
|
|
|
Set<Integer> positions = asSet(0, 1); |
|
|
|
// test that the commits b1, b2 and b3 are on the same position
|
|
|
|
CommitListAssert test = new CommitListAssert(pcl); |
|
|
|
int bPos = pcl.get(9).lane.position; // b1
|
|
|
|
int posA = test.commit(a5).lanePos(positions).getLanePos(); |
|
|
|
assertEquals("b2 is an a different position", bPos, |
|
|
|
test.commit(a4); |
|
|
|
pcl.get(7).lane.position); |
|
|
|
test.commit(a3).lanePos(posA); |
|
|
|
assertEquals("b3 is on a different position", bPos, |
|
|
|
test.commit(e); |
|
|
|
pcl.get(4).lane.position); |
|
|
|
test.commit(d); |
|
|
|
|
|
|
|
test.commit(a2).lanePos(posA); |
|
|
|
// test that nothing blocks the connections between b1, b2 and b3
|
|
|
|
int posB = test.commit(b3).lanePos(positions).getLanePos(); |
|
|
|
assertNotEquals("b lane is blocked by c", bPos, |
|
|
|
test.commit(b2).lanePos(posB); |
|
|
|
pcl.get(8).lane.position); |
|
|
|
test.commit(b1).lanePos(posB); |
|
|
|
assertNotEquals("b lane is blocked by a2", bPos, |
|
|
|
test.commit(c); |
|
|
|
pcl.get(6).lane.position); |
|
|
|
test.commit(a1).lanePos(posA); |
|
|
|
assertNotEquals("b lane is blocked by d", bPos, |
|
|
|
test.noMoreCommits(); |
|
|
|
pcl.get(5).lane.position); |
|
|
|
assertNotEquals("a lane is the same as b lane", posA, posB); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <pre> |
|
|
|
* <pre> |
|
|
|
* b3 |
|
|
|
* b3 |
|
|
|
* a5 | |
|
|
|
|
|
|
|
* | | |
|
|
|
|
|
|
|
* a4 | |
|
|
|
* a4 | |
|
|
|
* | \| |
|
|
|
* | \| |
|
|
|
* | b2 |
|
|
|
* | b2 |
|
|
|
* a3 | |
|
|
|
* a3 | |
|
|
|
* | \| |
|
|
|
* | \| |
|
|
|
* | b1 |
|
|
|
|
|
|
|
* a2 | |
|
|
|
* a2 | |
|
|
|
|
|
|
|
* | b1 |
|
|
|
* | / |
|
|
|
* | / |
|
|
|
* a1 |
|
|
|
* a1 |
|
|
|
* </pre> |
|
|
|
* </pre> |
|
|
@ -497,11 +494,10 @@ public class PlotCommitListTest extends RevWalkTestCase { |
|
|
|
final RevCommit a3 = commit(a2, b1); |
|
|
|
final RevCommit a3 = commit(a2, b1); |
|
|
|
final RevCommit b2 = commit(b1); |
|
|
|
final RevCommit b2 = commit(b1); |
|
|
|
final RevCommit a4 = commit(a3, b2); |
|
|
|
final RevCommit a4 = commit(a3, b2); |
|
|
|
final RevCommit a5 = commit(a4); |
|
|
|
|
|
|
|
final RevCommit b3 = commit(b2); |
|
|
|
final RevCommit b3 = commit(b2); |
|
|
|
|
|
|
|
|
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
try (PlotWalk pw = new PlotWalk(db)) { |
|
|
|
pw.markStart(pw.lookupCommit(a5)); |
|
|
|
pw.markStart(pw.lookupCommit(a4)); |
|
|
|
pw.markStart(pw.lookupCommit(b3)); |
|
|
|
pw.markStart(pw.lookupCommit(b3)); |
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); |
|
|
|
pcl.source(pw); |
|
|
|
pcl.source(pw); |
|
|
@ -510,12 +506,11 @@ public class PlotCommitListTest extends RevWalkTestCase { |
|
|
|
Set<Integer> positions = asSet(0, 1); |
|
|
|
Set<Integer> positions = asSet(0, 1); |
|
|
|
CommitListAssert test = new CommitListAssert(pcl); |
|
|
|
CommitListAssert test = new CommitListAssert(pcl); |
|
|
|
int posB = test.commit(b3).lanePos(positions).getLanePos(); |
|
|
|
int posB = test.commit(b3).lanePos(positions).getLanePos(); |
|
|
|
int posA = test.commit(a5).lanePos(positions).getLanePos(); |
|
|
|
int posA = test.commit(a4).lanePos(positions).getLanePos(); |
|
|
|
test.commit(a4).lanePos(posA); |
|
|
|
|
|
|
|
test.commit(b2).lanePos(posB); |
|
|
|
test.commit(b2).lanePos(posB); |
|
|
|
test.commit(a3).lanePos(posA); |
|
|
|
test.commit(a3).lanePos(posA); |
|
|
|
test.commit(b1).lanePos(posB); |
|
|
|
|
|
|
|
test.commit(a2).lanePos(posA); |
|
|
|
test.commit(a2).lanePos(posA); |
|
|
|
|
|
|
|
test.commit(b1).lanePos(posB); |
|
|
|
test.commit(a1).lanePos(posA); |
|
|
|
test.commit(a1).lanePos(posA); |
|
|
|
test.noMoreCommits(); |
|
|
|
test.noMoreCommits(); |
|
|
|
} |
|
|
|
} |
|
|
@ -524,17 +519,13 @@ public class PlotCommitListTest extends RevWalkTestCase { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* <pre> |
|
|
|
* <pre> |
|
|
|
* a4 |
|
|
|
* a4 |
|
|
|
* | |
|
|
|
* | b3 |
|
|
|
* a3 |
|
|
|
* a3 | |
|
|
|
* | \\ |
|
|
|
* | \\| |
|
|
|
* a2 \\ |
|
|
|
* | |\\ |
|
|
|
* | \\ |
|
|
|
* | b2|| |
|
|
|
* | b3 || |
|
|
|
* a2 | //
|
|
|
|
* | | || |
|
|
|
* | b1 |
|
|
|
* | b2 || |
|
|
|
|
|
|
|
* | | //
|
|
|
|
|
|
|
|
* | b1 |
|
|
|
|
|
|
|
* | | |
|
|
|
|
|
|
|
* | / |
|
|
|
* | / |
|
|
|
* a1 |
|
|
|
* a1 |
|
|
|
* </pre> |
|
|
|
* </pre> |
|
|
@ -561,10 +552,10 @@ public class PlotCommitListTest extends RevWalkTestCase { |
|
|
|
Set<Integer> positions = asSet(0, 1); |
|
|
|
Set<Integer> positions = asSet(0, 1); |
|
|
|
CommitListAssert test = new CommitListAssert(pcl); |
|
|
|
CommitListAssert test = new CommitListAssert(pcl); |
|
|
|
int posA = test.commit(a4).lanePos(positions).getLanePos(); |
|
|
|
int posA = test.commit(a4).lanePos(positions).getLanePos(); |
|
|
|
test.commit(a3).lanePos(posA); |
|
|
|
|
|
|
|
test.commit(a2).lanePos(posA); |
|
|
|
|
|
|
|
int posB = test.commit(b3).lanePos(positions).getLanePos(); |
|
|
|
int posB = test.commit(b3).lanePos(positions).getLanePos(); |
|
|
|
|
|
|
|
test.commit(a3).lanePos(posA); |
|
|
|
test.commit(b2).lanePos(posB); |
|
|
|
test.commit(b2).lanePos(posB); |
|
|
|
|
|
|
|
test.commit(a2).lanePos(posA); |
|
|
|
// b1 is not repositioned, uses "detour lane"
|
|
|
|
// b1 is not repositioned, uses "detour lane"
|
|
|
|
// (drawn as a double arc in the ascii graph above)
|
|
|
|
// (drawn as a double arc in the ascii graph above)
|
|
|
|
test.commit(b1).lanePos(posB); |
|
|
|
test.commit(b1).lanePos(posB); |
|
|
@ -578,14 +569,13 @@ public class PlotCommitListTest extends RevWalkTestCase { |
|
|
|
* b2 |
|
|
|
* b2 |
|
|
|
* a4 | |
|
|
|
* a4 | |
|
|
|
* | \ | |
|
|
|
* | \ | |
|
|
|
* | b1 |
|
|
|
* a3 \| |
|
|
|
* a3 | |
|
|
|
|
|
|
|
* | \ | |
|
|
|
* | \ | |
|
|
|
* | c | |
|
|
|
* | c | |
|
|
|
* | / | |
|
|
|
* | / | |
|
|
|
* a2 | |
|
|
|
* a2 | |
|
|
|
* | | |
|
|
|
* | b1 |
|
|
|
* | / |
|
|
|
* / |
|
|
|
* | / |
|
|
|
* | / |
|
|
|
* a1 |
|
|
|
* a1 |
|
|
|
* </pre> |
|
|
|
* </pre> |
|
|
@ -614,10 +604,10 @@ public class PlotCommitListTest extends RevWalkTestCase { |
|
|
|
CommitListAssert test = new CommitListAssert(pcl); |
|
|
|
CommitListAssert test = new CommitListAssert(pcl); |
|
|
|
int posB = test.commit(b2).lanePos(positions).getLanePos(); |
|
|
|
int posB = test.commit(b2).lanePos(positions).getLanePos(); |
|
|
|
int posA = test.commit(a4).lanePos(positions).getLanePos(); |
|
|
|
int posA = test.commit(a4).lanePos(positions).getLanePos(); |
|
|
|
test.commit(b1).lanePos(posB); // repositioned to go around c
|
|
|
|
|
|
|
|
test.commit(a3).lanePos(posA); |
|
|
|
test.commit(a3).lanePos(posA); |
|
|
|
test.commit(c).lanePos(positions); |
|
|
|
test.commit(c).lanePos(positions); |
|
|
|
test.commit(a2).lanePos(posA); |
|
|
|
test.commit(a2).lanePos(posA); |
|
|
|
|
|
|
|
test.commit(b1).lanePos(posB); // repositioned to go around c
|
|
|
|
test.commit(a1).lanePos(posA); |
|
|
|
test.commit(a1).lanePos(posA); |
|
|
|
test.noMoreCommits(); |
|
|
|
test.noMoreCommits(); |
|
|
|
} |
|
|
|
} |
|
|
|