summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Kügler <swamblumat-eclipsebugs@yahoo.de>2014-05-18 21:49:32 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2014-05-22 22:29:26 +0200
commitc4f3856b39958329c2f19341778c9ae6629d668a (patch)
treea3b8829edbf4fd82b47341640124dc35fe2bd3f1
parent09f6b1878af4792bce94d43351223a6a7a4b25a4 (diff)
downloadjgit-c4f3856b39958329c2f19341778c9ae6629d668a.tar.gz
jgit-c4f3856b39958329c2f19341778c9ae6629d668a.zip
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>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java15
1 files changed, 1 insertions, 14 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
index 9686e4568a..9cbd94e26f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
+++ b/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.
//
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);