/// <summary> /// Ensure this list contains at least a specified number of commits. /// /// The revision walker specified by <see cref="Source(RevWalk)"/> is pumped until /// the given number of commits are contained in this list. If there are /// fewer total commits available from the walk then the method will return /// early. Callers can test the size of the list by <see cref="RevObjectList{T}.Size"/> to /// determine if the high water mark specified was met. /// </summary> /// <param name="highMark"> /// Number of commits the caller wants this list to contain when /// the fill operation is complete. /// </param> public void fillTo(int highMark) { if (_walker == null || Size > highMark) { return; } Generator p = _walker.Pending; T c = (T)p.next(); if (c == null) { _walker.Pending = EndGenerator.Instance; _walker = null; return; } enter(Size, c); add(c); p = _walker.Pending; while (Size <= highMark) { int index = Size; Block s = Contents; while (index >> s.Shift >= BLOCK_SIZE) { s = new Block(s.Shift + BLOCK_SHIFT); s.Contents[0] = Contents; Contents = s; } while (s.Shift > 0) { int i = index >> s.Shift; index -= i << s.Shift; if (s.Contents[i] == null) { s.Contents[i] = new Block(s.Shift - BLOCK_SHIFT); } s = (Block)s.Contents[i]; } object[] dst = s.Contents; while (Size <= highMark && index < BLOCK_SIZE) { c = (T)p.next(); if (c == null) { _walker.Pending = EndGenerator.Instance; _walker = null; return; } enter(Size++, c); dst[index++] = c; } } }
public DateRevQueue(Generator s) { while (true) { RevCommit c = s.next(); if (c == null) break; add(c); } }
public DateRevQueue(Generator s) { while (true) { RevCommit c = s.next(); if (c == null) { break; } add(c); } }
public override RevCommit next() { RevCommit c = _source.next(); if (c != null) { foreach (RevCommit p in c.Parents) { if ((p.Flags & RevWalk.UNINTERESTING) != 0) { _held.add(p); } } return(c); } var boundary = new FIFORevQueue(); boundary.shareFreeList(_held); while (true) { c = _held.next(); if (c == null) { break; } if ((c.Flags & Duplicate) != 0) { continue; } if ((c.Flags & Parsed) == 0) { c.parseHeaders(_walk); } c.Flags |= Duplicate; boundary.add(c); } boundary.removeFlag(Duplicate); _parent._generator = boundary; return(boundary.next()); }