397
/// <summary>Ensures all commits until the given commit are loaded.</summary>
399
/// Ensures all commits until the given commit are loaded. The revision
400
/// walker specified by
401
/// <see cref="RevCommitList{E}.Source(RevWalk)">RevCommitList<E>.Source(RevWalk)
403
/// is pumped until the
404
/// specified commit is loaded. Callers can test the final size of the list
406
/// <see cref="RevObjectList{E}.Count()">RevObjectList<E>.Count()</see>
407
/// to determine if the high water mark specified was met.
410
/// <param name="commitToLoad">
411
/// commit the caller wants this list to contain when the fill
412
/// operation is complete.
414
/// <param name="highMark">
415
/// maximum number of commits the caller wants this list to
416
/// contain when the fill operation is complete. If highMark is 0
417
/// the walk is pumped until the specified commit or the end of
418
/// the walk is reached.
420
/// <exception cref="System.IO.IOException">
422
/// <see cref="RevWalk.Next()">RevWalk.Next()</see>
424
/// <exception cref="NGit.Errors.IncorrectObjectTypeException">
426
/// <see cref="RevWalk.Next()">RevWalk.Next()</see>
428
/// <exception cref="NGit.Errors.MissingObjectException">
430
/// <see cref="RevWalk.Next()">RevWalk.Next()</see>
432
public virtual void FillTo(RevCommit commitToLoad, int highMark)
434
if (walker == null || commitToLoad == null || (highMark > 0 && size > highMark))
438
RevCommit c = walker.Next();
446
while ((highMark == 0 || size <= highMark) && !c.Equals(commitToLoad))
449
RevObjectListBlock s = contents;
450
while (index >> s.shift >= BLOCK_SIZE)
452
s = new RevObjectListBlock(s.shift + BLOCK_SHIFT);
453
s.contents[0] = contents;
458
int i = index >> s.shift;
459
index -= i << s.shift;
460
if (s.contents[i] == null)
462
s.contents[i] = new RevObjectListBlock(s.shift - BLOCK_SHIFT);
464
s = (RevObjectListBlock)s.contents[i];
466
object[] dst = s.contents;
467
while ((highMark == 0 || size <= highMark) && index < BLOCK_SIZE && !c.Equals(commitToLoad
397
482
/// <summary>Optional callback invoked when commits enter the list by fillTo.</summary>
399
484
/// Optional callback invoked when commits enter the list by fillTo.