public override RevCommit next() { try { while (true) { RevCommit c = _pending.next(); if (c == null) { _walker.WindowCursor.Release(); return(null); } bool produce = !((c.Flags & UNINTERESTING) != 0) && _filter.include(_walker, c); foreach (RevCommit p in c.Parents) { if ((p.Flags & SEEN) != 0) { continue; } if ((p.Flags & PARSED) == 0) { p.parseHeaders(_walker); } p.Flags |= SEEN; _pending.add(p); } _walker.carryFlagsImpl(c); if ((c.Flags & UNINTERESTING) != 0) { if (_pending.everbodyHasFlag(UNINTERESTING)) { RevCommit n = _pending.peek(); if (n != null && n.CommitTime >= _last.CommitTime) { // This is too close to call. The Next commit we // would pop is dated After the last one produced. // We have to keep going to ensure that we carry // flags as much as necessary. // _overScan = OVER_SCAN; } else if (--_overScan == 0) { throw StopWalkException.INSTANCE; } } else { _overScan = OVER_SCAN; } if (CanDispose) { c.DisposeBody(); } continue; } if (produce) { return(_last = c); } if (CanDispose) { c.DisposeBody(); } } } catch (StopWalkException) { _walker.WindowCursor.Release(); _pending.clear(); return(null); } }
private void PushLocalCommit(RevCommit p) { if (p.has(LOCALLY_SEEN)) return; _revWalk.parseHeaders(p); p.add(LOCALLY_SEEN); p.add(COMPLETE); p.carry(COMPLETE); p.DisposeBody(); _localCommitQueue.add(p); }