|
|
@ -80,11 +80,11 @@ class TopoSortGenerator extends Generator { |
|
|
|
if (c == null) { |
|
|
|
if (c == null) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
for (int i = 0; i < c.parents.length; i++) { |
|
|
|
for (RevCommit p : c.parents) { |
|
|
|
if (firstParent && i > 0) { |
|
|
|
p.inDegree++; |
|
|
|
|
|
|
|
if (firstParent) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
c.parents[i].inDegree++; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
pending.add(c); |
|
|
|
pending.add(c); |
|
|
|
} |
|
|
|
} |
|
|
@ -119,11 +119,7 @@ class TopoSortGenerator extends Generator { |
|
|
|
// All of our children have already produced,
|
|
|
|
// All of our children have already produced,
|
|
|
|
// so it is OK for us to produce now as well.
|
|
|
|
// so it is OK for us to produce now as well.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
for (int i = 0; i < c.parents.length; i++) { |
|
|
|
for (RevCommit p : c.parents) { |
|
|
|
if (firstParent && i > 0) { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
RevCommit p = c.parents[i]; |
|
|
|
|
|
|
|
if (--p.inDegree == 0 && (p.flags & TOPO_DELAY) != 0) { |
|
|
|
if (--p.inDegree == 0 && (p.flags & TOPO_DELAY) != 0) { |
|
|
|
// This parent tried to come before us, but we are
|
|
|
|
// This parent tried to come before us, but we are
|
|
|
|
// his last child. unpop the parent so it goes right
|
|
|
|
// his last child. unpop the parent so it goes right
|
|
|
@ -132,6 +128,9 @@ class TopoSortGenerator extends Generator { |
|
|
|
p.flags &= ~TOPO_DELAY; |
|
|
|
p.flags &= ~TOPO_DELAY; |
|
|
|
pending.unpop(p); |
|
|
|
pending.unpop(p); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (firstParent) { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return c; |
|
|
|
return c; |
|
|
|
} |
|
|
|
} |
|
|
|