예제 #1
0
 public InitialGenerator(RevWalk w, Generator s, BoundaryGenerator parent) // [henon] parent needed because we cannot access outer instances in C#
 {
     walk = w;
     held = new FIFORevQueue();
     source = s;
     source.shareFreeList(held);
     this.parent = parent;
 }
예제 #2
0
 /**
  * Create a new sorter and completely spin the generator.
  * <p>
  * When the constructor completes the supplied generator will have no
  * commits remaining, as all of the commits will be held inside of this
  * generator's internal buffer.
  * 
  * @param s
  *            generator to pull all commits out of, and into this buffer.
  * @throws MissingObjectException
  * @throws IncorrectObjectTypeException
  * @
  */
 public TopoSortGenerator(Generator s)
 {
     pending = new FIFORevQueue();
     _outputType = s.outputType() | SORT_TOPO;
     s.shareFreeList(pending);
     for (; ; )
     {
         RevCommit c = s.next();
         if (c == null)
             break;
         foreach (RevCommit p in c.parents)
             p.inDegree++;
         pending.add(c);
     }
 }
        /// <summary>
        /// Create a new sorter and completely spin the generator.
        /// <para />
        /// When the constructor completes the supplied generator will have no
        /// commits remaining, as all of the commits will be held inside of this
        /// generator's internal buffer.
        /// </summary>
        /// <param name="s">
        /// Generator to pull all commits out of, and into this buffer.
        /// </param>
        public TopoSortGenerator(Generator s)
        {
            _pending = new FIFORevQueue();
            _outputType = s.OutputType | GeneratorOutputType.SortTopo;
            s.shareFreeList(_pending);

            while (true)
            {
                RevCommit c = s.next();
                if (c == null) break;
                foreach (RevCommit p in c.Parents)
                {
                    p.InDegree++;
                }
                _pending.add(c);
            }
        }
        /// <summary>
        /// Create a new sorter and completely spin the generator.
        /// <para />
        /// When the constructor completes the supplied generator will have no
        /// commits remaining, as all of the commits will be held inside of this
        /// generator's internal buffer.
        /// </summary>
        /// <param name="s">
        /// Generator to pull all commits out of, and into this buffer.
        /// </param>
        public TopoSortGenerator(Generator s)
        {
            _pending    = new FIFORevQueue();
            _outputType = s.OutputType | GeneratorOutputType.SortTopo;
            s.shareFreeList(_pending);

            while (true)
            {
                RevCommit c = s.next();
                if (c == null)
                {
                    break;
                }
                foreach (RevCommit p in c.Parents)
                {
                    p.InDegree++;
                }
                _pending.add(c);
            }
        }
예제 #5
0
        public void testCloneFIFO()
        {
            RevCommit a = parseBody(Commit());
            RevCommit b = parseBody(Commit(200, a));
            RevCommit c = parseBody(Commit(200, b));

            var src = new FIFORevQueue();

            src.add(a);
            src.add(b);
            src.add(c);

            q = new DateRevQueue(src);
            Assert.IsFalse(q.everbodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));
            Assert.IsFalse(q.anybodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));
            AssertCommit(c, q.peek());
            AssertCommit(c, q.peek());

            AssertCommit(c, q.next());
            AssertCommit(b, q.next());
            AssertCommit(a, q.next());
            Assert.IsNull(q.next());
        }
예제 #6
0
 // [henon] parent needed because we cannot access outer instances in C#
 public InitialGenerator(RevWalk w, Generator s, BoundaryGenerator parent)
 {
     _walk = w;
     _held = new FIFORevQueue();
     _source = s;
     _source.shareFreeList(_held);
     _parent = parent;
 }
예제 #7
0
            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();
            }
예제 #8
0
 public DelayRevQueue(Generator g)
 {
     _pending = g;
     _delay = new FIFORevQueue();
 }
예제 #9
0
            public override RevCommit next()
            {
                RevCommit c = source.next();
                if (c != null)
                {
                    foreach (RevCommit p in c.parents)
                        if ((p.flags & UNINTERESTING) != 0)
                            held.add(p);
                    return c;
                }

                FIFORevQueue boundary = new FIFORevQueue();
                boundary.shareFreeList(held);
                for (; ; )
                {
                    c = held.next();
                    if (c == null)
                        break;
                    if ((c.flags & DUPLICATE) != 0)
                        continue;
                    if ((c.flags & PARSED) == 0)
                        c.parse(walk);
                    c.flags |= DUPLICATE;
                    boundary.add(c);
                }
                boundary.removeFlag(DUPLICATE);
                parent.g = boundary;
                return boundary.next();
            }
예제 #10
0
 public DelayRevQueue(Generator g)
 {
     _pending = g;
     _delay   = new FIFORevQueue();
 }