Browse Source

PlotCommitList: Remove handling of children that have no lane yet

Child commits always have a lane assigned when their parents are
processed, so this code is no longer necessary.

Children only assign themselves to parents in
PlotCommitList.setupChildren(), which is called from enter(), when the
child is processed. If the child leaves enter() it should always have a
lane assigned. As a result of this, when processing a parent, all its
known children already have lanes assigned. If the underlying RevWalk
emits a parent before one of its children (which it should not do), the
parent does not know of the child emitted later, because setupChildren()
has not been called for the child yet. So even in this case, no child
without a lane is encountered when processing a (parent) commit.

Change-Id: I982adc5c114370ecfd699d96221a76463de900ca
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-3.4
Konrad Kügler 11 years ago committed by Matthias Sohn
parent
commit
c4f3856b39
  1. 15
      org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java

15
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java

@ -130,11 +130,6 @@ public class PlotCommitList<L extends PlotLane> extends
// Stay in the same lane as the child. // Stay in the same lane as the child.
// //
final PlotCommit c = currCommit.children[0]; final PlotCommit c = currCommit.children[0];
if (c.lane == null) {
// Hmmph. This child must be the first along this lane.
//
c.lane = nextFreeLane();
}
for (int r = index - 1; r >= 0; r--) { for (int r = index - 1; r >= 0; r--) {
final PlotCommit rObj = get(r); final PlotCommit rObj = get(r);
if (rObj == c) if (rObj == c)
@ -169,15 +164,7 @@ public class PlotCommitList<L extends PlotLane> extends
for (int i = 0; i < nChildren; i++) { for (int i = 0; i < nChildren; i++) {
final PlotCommit c = currCommit.children[i]; final PlotCommit c = currCommit.children[i];
// don't forget to position all of your children if they are if (reservedLane == null && activeLanes.contains(c.lane))
// not already positioned.
if (c.lane == null) {
c.lane = nextFreeLane();
if (reservedLane != null)
closeLane(c.lane);
else
reservedLane = c.lane;
} else if (reservedLane == null && activeLanes.contains(c.lane))
reservedLane = c.lane; reservedLane = c.lane;
else else
closeLane(c.lane); closeLane(c.lane);

Loading…
Cancel
Save