Fixed uncommited changes parent node lane position
This commit is contained in:
parent
ba4c9596f8
commit
b63614d68d
@ -61,9 +61,11 @@ class GraphCommitList : RevCommitList<GraphNode>() {
|
||||
}
|
||||
|
||||
override fun enter(index: Int, currCommit: GraphNode) {
|
||||
if(currCommit.id == parentId) {
|
||||
var isUncommitedChangesNodeParent = false
|
||||
if (currCommit.id == parentId) {
|
||||
graphCommit.graphParent = currCommit
|
||||
currCommit.addChild(graphCommit, addFirst = true)
|
||||
isUncommitedChangesNodeParent = true
|
||||
}
|
||||
|
||||
setupChildren(currCommit)
|
||||
@ -80,7 +82,7 @@ class GraphCommitList : RevCommitList<GraphNode>() {
|
||||
var len = laneLength[currCommit.lane]
|
||||
len = if (len != null) Integer.valueOf(len.toInt() + 1) else Integer.valueOf(0)
|
||||
|
||||
if(currCommit.lane.position != INVALID_LANE_POSITION)
|
||||
if (currCommit.lane.position != INVALID_LANE_POSITION)
|
||||
laneLength[currCommit.lane] = len
|
||||
} else {
|
||||
// More than one child, or our child is a merge.
|
||||
@ -100,6 +102,16 @@ class GraphCommitList : RevCommitList<GraphNode>() {
|
||||
var reservedLane: GraphLane? = null
|
||||
var childOnReservedLane: GraphNode? = null
|
||||
var lengthOfReservedLane = -1
|
||||
|
||||
|
||||
if (isUncommitedChangesNodeParent) {
|
||||
val length = laneLength[graphCommit.lane]
|
||||
if (length != null) {
|
||||
reservedLane = graphCommit.lane
|
||||
childOnReservedLane = graphCommit
|
||||
lengthOfReservedLane = length
|
||||
}
|
||||
} else {
|
||||
for (i in 0 until nChildren) {
|
||||
val c: GraphNode = currCommit.children[i]
|
||||
if (c.getGraphParent(0) === currCommit) {
|
||||
@ -117,6 +129,7 @@ class GraphCommitList : RevCommitList<GraphNode>() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (reservedLane != null) {
|
||||
currCommit.lane = reservedLane
|
||||
laneLength[reservedLane] = Integer.valueOf(lengthOfReservedLane + 1)
|
||||
|
Loading…
Reference in New Issue
Block a user