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>
tags/v3.4.0.201405281120-rc2
Konrad Kügler 10 years ago
parent
commit
c4f3856b39
1 changed files with 1 additions and 14 deletions
  1. 1
    14
      org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java

+ 1
- 14
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java View File

@@ -130,11 +130,6 @@ public class PlotCommitList<L extends PlotLane> extends
// Stay in the same lane as the child.
//
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--) {
final PlotCommit rObj = get(r);
if (rObj == c)
@@ -169,15 +164,7 @@ public class PlotCommitList<L extends PlotLane> extends

for (int i = 0; i < nChildren; i++) {
final PlotCommit c = currCommit.children[i];
// don't forget to position all of your children if they are
// 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))
if (reservedLane == null && activeLanes.contains(c.lane))
reservedLane = c.lane;
else
closeLane(c.lane);

Loading…
Cancel
Save