public virtual void TestCommitTimeRevFilter()
        {
            RevCommit a = Commit();

            Tick(100);
            RevCommit b = Commit(a);

            Tick(100);
            DateTime  since = GetClock();
            RevCommit c1    = Commit(b);

            Tick(100);
            RevCommit c2 = Commit(b);

            Tick(100);
            DateTime  until = GetClock();
            RevCommit d     = Commit(c1, c2);

            Tick(100);
            RevCommit e = Commit(d);
            {
                RevFilter after = CommitTimeRevFilter.After(since);
                NUnit.Framework.Assert.IsNotNull(after);
                rw.SetRevFilter(after);
                MarkStart(e);
                AssertCommit(e, rw.Next());
                AssertCommit(d, rw.Next());
                AssertCommit(c2, rw.Next());
                AssertCommit(c1, rw.Next());
                NUnit.Framework.Assert.IsNull(rw.Next());
            }
            {
                RevFilter before = CommitTimeRevFilter.Before(until);
                NUnit.Framework.Assert.IsNotNull(before);
                rw.Reset();
                rw.SetRevFilter(before);
                MarkStart(e);
                AssertCommit(c2, rw.Next());
                AssertCommit(c1, rw.Next());
                AssertCommit(b, rw.Next());
                AssertCommit(a, rw.Next());
                NUnit.Framework.Assert.IsNull(rw.Next());
            }
            {
                RevFilter between = CommitTimeRevFilter.Between(since, until);
                NUnit.Framework.Assert.IsNotNull(between);
                rw.Reset();
                rw.SetRevFilter(between);
                MarkStart(e);
                AssertCommit(c2, rw.Next());
                AssertCommit(c1, rw.Next());
                NUnit.Framework.Assert.IsNull(rw.Next());
            }
        }
Beispiel #2
0
        public void testCommitTimeRevFilter()
        {
            RevCommit a = Commit();

            Tick(100);

            RevCommit b = Commit(a);

            Tick(100);

            DateTime  since = (nowTick).MillisToDateTime();
            RevCommit c1    = Commit(b);

            Tick(100);

            RevCommit c2 = Commit(b);

            Tick(100);

            DateTime  until = (nowTick).MillisToDateTime();
            RevCommit d     = Commit(c1, c2);

            Tick(100);

            RevCommit e = Commit(d);

            {
                RevFilter after = CommitTimeRevFilter.After(since);
                Assert.IsNotNull(after);
                rw.setRevFilter(after);
                MarkStart(e);
                AssertCommit(e, rw.next());
                AssertCommit(d, rw.next());
                AssertCommit(c2, rw.next());
                AssertCommit(c1, rw.next());
                Assert.IsNull(rw.next());
            }

            {
                RevFilter before = CommitTimeRevFilter.Before(until);
                Assert.IsNotNull(before);
                rw.reset();
                rw.setRevFilter(before);
                MarkStart(e);
                AssertCommit(c2, rw.next());
                AssertCommit(c1, rw.next());
                AssertCommit(b, rw.next());
                AssertCommit(a, rw.next());
                Assert.IsNull(rw.next());
            }

            {
                RevFilter between = CommitTimeRevFilter.Between(since, until);
                Assert.IsNotNull(between);
                rw.reset();
                rw.setRevFilter(between);
                MarkStart(e);
                AssertCommit(c2, rw.next());
                AssertCommit(c1, rw.next());
                Assert.IsNull(rw.next());
            }
        }