/**
  * Create a new filter that tests all flags in a set.
  * 
  * @param a
  *            set of flags to test.
  * @return filter that selects only commits with all flags in <code>a</code>.
  */
 public static RevFilter hasAll(params RevFlag[] a)
 {
     RevFlagSet set = new RevFlagSet();
     foreach (RevFlag flag in a)
         set.Add(flag);
     return new HasAll(set);
 }
Exemple #2
0
        /// <summary>Create a new filter that tests for a single flag.</summary>
        /// <remarks>Create a new filter that tests for a single flag.</remarks>
        /// <param name="a">the flag to test.</param>
        /// <returns>filter that selects only commits with flag <code>a</code>.</returns>
        public static RevFilter Has(RevFlag a)
        {
            RevFlagSet s = new RevFlagSet();

            s.AddItem(a);
            return(new RevFlagFilter.HasAll(s));
        }
	public void testEmpty() {
		final RevFlagSet set = new RevFlagSet();
		assertEquals(0, set.mask);
		assertEquals(0, set.size());
		assertNotNull(set.iterator());
		assertFalse(set.iterator().hasNext());
	}
Exemple #4
0
		public void testEmpty()
		{
			var flagSet = new RevFlagSet();
			Assert.AreEqual(0, flagSet.Mask);
			Assert.AreEqual(0, flagSet.Count);
			Assert.IsNotNull(flagSet.GetEnumerator());
			Assert.IsFalse(flagSet.GetEnumerator().MoveNext());
		}
Exemple #5
0
		public virtual void TestEmpty()
		{
			RevFlagSet set = new RevFlagSet();
			NUnit.Framework.Assert.AreEqual(0, set.mask);
			NUnit.Framework.Assert.AreEqual(0, set.Count);
			NUnit.Framework.Assert.IsNotNull(set.Iterator());
			NUnit.Framework.Assert.IsFalse(set.Iterator().HasNext());
		}
        /// <summary>
        /// Create a new filter that tests for a single flag.
        ///	</summary>
        /// <param name="a">The flag to test.</param>
        ///	<returns>
        /// Filter that selects only commits with flag <paramref name="a"/>.
        /// </returns>
        public static RevFilter has(RevFlag a)
        {
            var s = new RevFlagSet {
                a
            };

            return(new HasAll(s));
        }
Exemple #7
0
		/// <summary>Create a new filter that tests all flags in a set.</summary>
		/// <remarks>Create a new filter that tests all flags in a set.</remarks>
		/// <param name="a">set of flags to test.</param>
		/// <returns>filter that selects only commits with all flags in <code>a</code>.</returns>
		public static RevFilter HasAllFilter(params RevFlag[] a)
		{
			RevFlagSet set = new RevFlagSet();
			foreach (RevFlag flag in a)
			{
				set.AddItem(flag);
			}
			return new RevFlagFilter.HasAll(set);
		}
Exemple #8
0
        public void testEmpty()
        {
            var flagSet = new RevFlagSet();

            Assert.AreEqual(0, flagSet.Mask);
            Assert.AreEqual(0, flagSet.Count);
            Assert.IsNotNull(flagSet.GetEnumerator());
            Assert.IsFalse(flagSet.GetEnumerator().MoveNext());
        }
Exemple #9
0
        /// <summary>Create a new filter that tests for any flag in a set.</summary>
        /// <remarks>Create a new filter that tests for any flag in a set.</remarks>
        /// <param name="a">set of flags to test.</param>
        /// <returns>filter that selects only commits with any flag in <code>a</code>.</returns>
        public static RevFilter HasAnyFilter(params RevFlag[] a)
        {
            RevFlagSet set = new RevFlagSet();

            foreach (RevFlag flag in a)
            {
                set.AddItem(flag);
            }
            return(new RevFlagFilter.HasAny(set));
        }
        ///	<summary>
        /// Create a new filter that tests for any flag in a set.
        ///	</summary>
        ///	<param name="a">Set of flags to test. </param>
        ///	<returns>
        /// Filter that selects only commits with any flag in <code>a</code>.
        /// </returns>
        public static RevFilter hasAny(params RevFlag[] a)
        {
            var set = new RevFlagSet();

            foreach (RevFlag flag in a)
            {
                set.Add(flag);
            }
            return(new HasAny(set));
        }
Exemple #11
0
		public virtual void TestAddTwo()
		{
			RevFlag flag1 = rw.NewFlag("flag_1");
			RevFlag flag2 = rw.NewFlag("flag_2");
			NUnit.Framework.Assert.AreEqual(0, (flag1.mask & flag2.mask));
			RevFlagSet set = new RevFlagSet();
			NUnit.Framework.Assert.IsTrue(set.AddItem(flag1));
			NUnit.Framework.Assert.IsTrue(set.AddItem(flag2));
			NUnit.Framework.Assert.AreEqual(flag1.mask | flag2.mask, set.mask);
			NUnit.Framework.Assert.AreEqual(2, set.Count);
		}
	public void testAddTwo() {
		final RevFlag flag1 = rw.newFlag("flag_1");
		final RevFlag flag2 = rw.newFlag("flag_2");
		assertTrue((flag1.mask & flag2.mask) == 0);

		final RevFlagSet set = new RevFlagSet();
		assertTrue(set.add(flag1));
		assertTrue(set.add(flag2));
		assertEquals(flag1.mask | flag2.mask, set.mask);
		assertEquals(2, set.size());
	}
Exemple #13
0
        public void testEquals()
        {
            RevFlag flag1   = rw.newFlag("flag_1");
            RevFlag flag2   = rw.newFlag("flag_2");
            var     flagSet = new RevFlagSet();

            Assert.IsTrue(flagSet.Add(flag1));
            Assert.IsTrue(flagSet.Add(flag2));

            Assert.IsTrue(new RevFlagSet(flagSet).Equals(flagSet));
            Assert.IsTrue(new RevFlagSet(new[] { flag1, flag2 }).Equals(flagSet));
        }
Exemple #14
0
        public virtual void testContains()
        {
            RevFlag flag1   = rw.newFlag("flag_1");
            RevFlag flag2   = rw.newFlag("flag_2");
            var     flagSet = new RevFlagSet {
                flag1
            };

            Assert.IsTrue(flagSet.Contains(flag1));
            Assert.IsFalse(flagSet.Contains(flag2));
            //Assert.IsFalse(flagSet.Contains("bob"));
        }
Exemple #15
0
        public void testAddRevFlagSet()
        {
            RevCommit a = Commit();
            RevFlag flag1 = rw.newFlag("flag1");
            RevFlag flag2 = rw.newFlag("flag2");
            var s = new RevFlagSet { flag1, flag2 };

            Assert.AreEqual(0, a.Flags);

            a.add(s);
            Assert.AreEqual(flag1.Mask | flag2.Mask, a.Flags);
        }
Exemple #16
0
        public void testAddTwo()
        {
            RevFlag flag1 = rw.newFlag("flag_1");
            RevFlag flag2 = rw.newFlag("flag_2");
            Assert.IsTrue((flag1.Mask & flag2.Mask) == 0);

            var flagSet = new RevFlagSet();
            Assert.IsTrue(flagSet.Add(flag1));
            Assert.IsTrue(flagSet.Add(flag2));
            Assert.AreEqual(flag1.Mask | flag2.Mask, flagSet.Mask);
            Assert.AreEqual(2, flagSet.Count);
        }
Exemple #17
0
        public void testHasAnyFlag()
        {
            RevCommit a     = Commit();
            RevFlag   flag1 = rw.newFlag("flag1");
            RevFlag   flag2 = rw.newFlag("flag2");
            var       s     = new RevFlagSet {
                flag1, flag2
            };

            Assert.IsFalse(a.hasAny(s));
            a.Flags |= flag1.Mask;
            Assert.IsTrue(a.hasAny(s));
        }
Exemple #18
0
        public void testAddTwo()
        {
            RevFlag flag1 = rw.newFlag("flag_1");
            RevFlag flag2 = rw.newFlag("flag_2");

            Assert.IsTrue((flag1.Mask & flag2.Mask) == 0);

            var flagSet = new RevFlagSet();

            Assert.IsTrue(flagSet.Add(flag1));
            Assert.IsTrue(flagSet.Add(flag2));
            Assert.AreEqual(flag1.Mask | flag2.Mask, flagSet.Mask);
            Assert.AreEqual(2, flagSet.Count);
        }
Exemple #19
0
        public virtual void testRemove()
        {
            RevFlag flag1   = rw.newFlag("flag_1");
            RevFlag flag2   = rw.newFlag("flag_2");
            var     flagSet = new RevFlagSet();

            Assert.IsTrue(flagSet.Add(flag1));
            Assert.IsTrue(flagSet.Add(flag2));

            Assert.IsTrue(flagSet.Remove(flag1));
            Assert.IsFalse(flagSet.Remove(flag1));
            Assert.AreEqual(flag2.Mask, flagSet.Mask);
            Assert.IsFalse(flagSet.Contains(flag1));
        }
Exemple #20
0
        public void testAddRevFlagSet()
        {
            RevCommit a     = Commit();
            RevFlag   flag1 = rw.newFlag("flag1");
            RevFlag   flag2 = rw.newFlag("flag2");
            var       s     = new RevFlagSet {
                flag1, flag2
            };

            Assert.AreEqual(0, a.Flags);

            a.add(s);
            Assert.AreEqual(flag1.Mask | flag2.Mask, a.Flags);
        }
	public void testAddOne() {
		final String flagName = "flag";
		final RevFlag flag = rw.newFlag(flagName);
		assertTrue(0 != flag.mask);
		assertSame(flagName, flag.name);

		final RevFlagSet set = new RevFlagSet();
		assertTrue(set.add(flag));
		assertFalse(set.add(flag));
		assertEquals(flag.mask, set.mask);
		assertEquals(1, set.size());
		final Iterator<RevFlag> i = set.iterator();
		assertTrue(i.hasNext());
		assertSame(flag, i.next());
		assertFalse(i.hasNext());
	}
Exemple #22
0
        public void testRemoveRevFlagSet()
        {
            RevCommit a     = Commit();
            RevFlag   flag1 = rw.newFlag("flag1");
            RevFlag   flag2 = rw.newFlag("flag2");
            RevFlag   flag3 = rw.newFlag("flag3");
            var       s     = new RevFlagSet {
                flag1, flag2
            };

            a.add(flag3);
            a.add(s);
            Assert.AreEqual(flag1.Mask | flag2.Mask | flag3.Mask, a.Flags);
            a.remove(s);
            Assert.AreEqual(flag3.Mask, a.Flags);
        }
Exemple #23
0
		public virtual void TestAddOne()
		{
			string flagName = "flag";
			RevFlag flag = rw.NewFlag(flagName);
			NUnit.Framework.Assert.IsTrue(0 != flag.mask);
			NUnit.Framework.Assert.AreSame(flagName, flag.name);
			RevFlagSet set = new RevFlagSet();
			NUnit.Framework.Assert.IsTrue(set.AddItem(flag));
			NUnit.Framework.Assert.IsFalse(set.AddItem(flag));
			NUnit.Framework.Assert.AreEqual(flag.mask, set.mask);
			NUnit.Framework.Assert.AreEqual(1, set.Count);
			Iterator<RevFlag> i = set.Iterator();
			NUnit.Framework.Assert.IsTrue(i.HasNext());
			NUnit.Framework.Assert.AreSame(flag, i.Next());
			NUnit.Framework.Assert.IsFalse(i.HasNext());
		}
Exemple #24
0
 /// <summary>Create a new pack upload for an open repository.</summary>
 /// <remarks>Create a new pack upload for an open repository.</remarks>
 /// <param name="copyFrom">the source repository.</param>
 public UploadPack(Repository copyFrom)
 {
     db   = copyFrom;
     walk = new RevWalk(db);
     walk.SetRetainBody(false);
     WANT      = walk.NewFlag("WANT");
     PEER_HAS  = walk.NewFlag("PEER_HAS");
     COMMON    = walk.NewFlag("COMMON");
     SATISFIED = walk.NewFlag("SATISFIED");
     walk.Carry(PEER_HAS);
     SAVE = new RevFlagSet();
     SAVE.AddItem(WANT);
     SAVE.AddItem(PEER_HAS);
     SAVE.AddItem(COMMON);
     SAVE.AddItem(SATISFIED);
     refFilter = RefFilter.DEFAULT;
 }
Exemple #25
0
        public void testAddOne()
        {
            const string flagName = "flag";
            RevFlag flag = rw.newFlag(flagName);
            Assert.IsTrue(0 != flag.Mask);
            Assert.AreSame(flagName, flag.Name);

            var flagSet = new RevFlagSet();
            Assert.IsTrue(flagSet.Add(flag));
            Assert.IsFalse(flagSet.Add(flag));
            Assert.AreEqual(flag.Mask, flagSet.Mask);
            Assert.AreEqual(1, flagSet.Count);
            var i = flagSet.GetEnumerator();
            Assert.IsTrue(i.MoveNext());
            Assert.AreSame(flag, i.Current);
            Assert.IsFalse(i.MoveNext());
        }
Exemple #26
0
        ///	<summary>
        /// Create a new pack upload for an open repository.
        /// </summary>
        /// <param name="copyFrom">the source repository.</param>
        public UploadPack(Repository copyFrom)
        {
            _db   = copyFrom;
            _walk = new RevWalk.RevWalk(_db);
            _walk.setRetainBody(false);

            ADVERTISED = _walk.newFlag("ADVERTISED");
            WANT       = _walk.newFlag("WANT");
            PEER_HAS   = _walk.newFlag("PEER_HAS");
            COMMON     = _walk.newFlag("COMMON");
            _walk.carry(PEER_HAS);

            SAVE = new RevFlagSet {
                ADVERTISED, WANT, PEER_HAS
            };
            _refFilter = RefFilterContants.DEFAULT;
        }
Exemple #27
0
        public void testContainsAll()
        {
            RevFlag flag1 = rw.newFlag("flag_1");
            RevFlag flag2 = rw.newFlag("flag_2");
            var     set1  = new RevFlagSet();

            Assert.IsTrue(set1.Add(flag1));
            Assert.IsTrue(set1.Add(flag2));

            Assert.IsTrue(set1.ContainsAll(set1));
            Assert.IsTrue(set1.ContainsAll(new[] { flag1, flag2 }));

            var set2 = new RevFlagSet {
                rw.newFlag("flag_3")
            };

            Assert.IsFalse(set1.ContainsAll(set2));
        }
Exemple #28
0
        public void testAddOne()
        {
            const string flagName = "flag";
            RevFlag      flag     = rw.newFlag(flagName);

            Assert.IsTrue(0 != flag.Mask);
            Assert.AreSame(flagName, flag.Name);

            var flagSet = new RevFlagSet();

            Assert.IsTrue(flagSet.Add(flag));
            Assert.IsFalse(flagSet.Add(flag));
            Assert.AreEqual(flag.Mask, flagSet.Mask);
            Assert.AreEqual(1, flagSet.Count);
            var i = flagSet.GetEnumerator();

            Assert.IsTrue(i.MoveNext());
            Assert.AreSame(flag, i.Current);
            Assert.IsFalse(i.MoveNext());
        }
Exemple #29
0
        ///	<summary>
        /// Create a new pack upload for an open repository.
        /// </summary>
        /// <param name="copyFrom">the source repository.</param>
        public UploadPack(Repository copyFrom)
        {
            _options     = new List <string>();
            _wantAll     = new List <RevObject>();
            _wantCommits = new List <RevCommit>();
            _commonBase  = new List <RevObject>();

            _db   = copyFrom;
            _walk = new RevWalk.RevWalk(_db);
            _walk.setRetainBody(false);

            ADVERTISED = _walk.newFlag("ADVERTISED");
            WANT       = _walk.newFlag("WANT");
            PEER_HAS   = _walk.newFlag("PEER_HAS");
            COMMON     = _walk.newFlag("COMMON");
            _walk.carry(PEER_HAS);

            SAVE = new RevFlagSet {
                ADVERTISED, WANT, PEER_HAS
            };
        }
Exemple #30
0
 public virtual void testContains()
 {
     RevFlag flag1 = rw.newFlag("flag_1");
     RevFlag flag2 = rw.newFlag("flag_2");
     var flagSet = new RevFlagSet {flag1};
     Assert.IsTrue(flagSet.Contains(flag1));
     Assert.IsFalse(flagSet.Contains(flag2));
     //Assert.IsFalse(flagSet.Contains("bob"));
 }
Exemple #31
0
        public void testContainsAll()
        {
            RevFlag flag1 = rw.newFlag("flag_1");
            RevFlag flag2 = rw.newFlag("flag_2");
            var set1 = new RevFlagSet();
            Assert.IsTrue(set1.Add(flag1));
            Assert.IsTrue(set1.Add(flag2));

            Assert.IsTrue(set1.ContainsAll(set1));
            Assert.IsTrue(set1.ContainsAll(new[] { flag1, flag2 }));

            var set2 = new RevFlagSet { rw.newFlag("flag_3") };
            Assert.IsFalse(set1.ContainsAll(set2));
        }
 public HasAll(RevFlagSet m)
     : base(m)
 {
 }
Exemple #33
0
        public void testEquals()
        {
            RevFlag flag1 = rw.newFlag("flag_1");
            RevFlag flag2 = rw.newFlag("flag_2");
            var flagSet = new RevFlagSet();
            Assert.IsTrue(flagSet.Add(flag1));
            Assert.IsTrue(flagSet.Add(flag2));

            Assert.IsTrue(new RevFlagSet(flagSet).Equals(flagSet));
            Assert.IsTrue(new RevFlagSet(new[] { flag1, flag2 }).Equals(flagSet));
        }
Exemple #34
0
 /// <summary>
 /// Add a set of flags to this object.
 /// </summary>
 /// <param name="set">
 /// The set of flags to mark on this object, for later testing.
 /// </param>
 public void add(RevFlagSet set)
 {
     Flags |= set.Mask;
 }
Exemple #35
0
 /// <summary>
 /// Test to see if all flags in the set have been set on this object.
 /// </summary>
 /// <param name="set">the flags to test.</param>
 /// <returns>true if all flags of the set have been added to this object;
 /// false if some or none have been added.
 /// </returns>
 public bool hasAll(RevFlagSet set)
 {
     return (Flags & set.Mask) == set.Mask;
 }
Exemple #36
0
        public UploadPack(Repository copyFrom)
        {
            db = copyFrom;
            walk = new RevWalk.RevWalk(db);

            ADVERTISED = walk.newFlag("ADVERTISED");
            WANT = walk.newFlag("WANT");
            PEER_HAS = walk.newFlag("PEER_HAS");
            COMMON = walk.newFlag("COMMON");
            walk.carry(PEER_HAS);

            SAVE = new RevFlagSet();
            SAVE.Add(ADVERTISED);
            SAVE.Add(WANT);
            SAVE.Add(PEER_HAS);
        }
Exemple #37
0
 internal RevFlagFilter(RevFlagSet m)
 {
     flags = m;
 }
Exemple #38
0
 internal HasAny(RevFlagSet m) : base(m)
 {
 }
Exemple #39
0
		public virtual void TestContainsAll()
		{
			RevFlag flag1 = rw.NewFlag("flag_1");
			RevFlag flag2 = rw.NewFlag("flag_2");
			RevFlagSet set1 = new RevFlagSet();
			NUnit.Framework.Assert.IsTrue(set1.AddItem(flag1));
			NUnit.Framework.Assert.IsTrue(set1.AddItem(flag2));
			NUnit.Framework.Assert.IsTrue(set1.ContainsAll(set1));
			NUnit.Framework.Assert.IsTrue(set1.ContainsAll(Arrays.AsList(new RevFlag[] { flag1
				, flag2 })));
			RevFlagSet set2 = new RevFlagSet();
			set2.AddItem(rw.NewFlag("flag_3"));
			NUnit.Framework.Assert.IsFalse(set1.ContainsAll(set2));
		}
 ///	<summary>
 /// Create a new filter that tests all flags in a set.
 ///	</summary>
 ///	<param name="a">Set of flags to test.</param>
 ///	<returns> filter that selects only commits with all flags in <paramref name="a"/>.
 /// </returns>
 public static RevFilter hasAll(RevFlagSet a)
 {
     return(new HasAll(new RevFlagSet(a)));
 }
Exemple #41
0
        ///	<summary>
        /// Create a new pack upload for an open repository.
        /// </summary>
        /// <param name="copyFrom">the source repository.</param>
        public UploadPack(Repository copyFrom)
        {
            _db = copyFrom;
            _walk = new RevWalk.RevWalk(_db);
            _walk.setRetainBody(false);

            ADVERTISED = _walk.newFlag("ADVERTISED");
            WANT = _walk.newFlag("WANT");
            PEER_HAS = _walk.newFlag("PEER_HAS");
            COMMON = _walk.newFlag("COMMON");
            _walk.carry(PEER_HAS);

            SAVE = new RevFlagSet { ADVERTISED, WANT, PEER_HAS };
            _refFilter = RefFilterContants.DEFAULT;
        }
Exemple #42
0
 /// <summary>Create a new filter that tests all flags in a set.</summary>
 /// <remarks>Create a new filter that tests all flags in a set.</remarks>
 /// <param name="a">set of flags to test.</param>
 /// <returns>filter that selects only commits with all flags in <code>a</code>.</returns>
 public static RevFilter HasAllFilter(RevFlagSet a)
 {
     return(new RevFlagFilter.HasAll(new RevFlagSet(a)));
 }
Exemple #43
0
		public virtual void TestEquals()
		{
			RevFlag flag1 = rw.NewFlag("flag_1");
			RevFlag flag2 = rw.NewFlag("flag_2");
			RevFlagSet set = new RevFlagSet();
			NUnit.Framework.Assert.IsTrue(set.AddItem(flag1));
			NUnit.Framework.Assert.IsTrue(set.AddItem(flag2));
			NUnit.Framework.Assert.AreEqual(set, new RevFlagSet(set));
			NUnit.Framework.Assert.IsTrue(new RevFlagSet(Arrays.AsList(new RevFlag[] { flag1, 
				flag2 })).Equals(set));
		}
Exemple #44
0
		public virtual void TestContains()
		{
			RevFlag flag1 = rw.NewFlag("flag_1");
			RevFlag flag2 = rw.NewFlag("flag_2");
			RevFlagSet set = new RevFlagSet();
			set.AddItem(flag1);
			NUnit.Framework.Assert.IsTrue(set.Contains(flag1));
			NUnit.Framework.Assert.IsFalse(set.Contains(flag2));
			NUnit.Framework.Assert.IsFalse(set.Contains("bob"));
		}
Exemple #45
0
		public virtual void TestRemove()
		{
			RevFlag flag1 = rw.NewFlag("flag_1");
			RevFlag flag2 = rw.NewFlag("flag_2");
			RevFlagSet set = new RevFlagSet();
			NUnit.Framework.Assert.IsTrue(set.AddItem(flag1));
			NUnit.Framework.Assert.IsTrue(set.AddItem(flag2));
			NUnit.Framework.Assert.IsTrue(set.Remove(flag1));
			NUnit.Framework.Assert.IsFalse(set.Remove(flag1));
			NUnit.Framework.Assert.AreEqual(flag2.mask, set.mask);
			NUnit.Framework.Assert.IsFalse(set.Contains(flag1));
		}
Exemple #46
0
 public void testRemoveRevFlagSet()
 {
     RevCommit a = Commit();
     RevFlag flag1 = rw.newFlag("flag1");
     RevFlag flag2 = rw.newFlag("flag2");
     RevFlag flag3 = rw.newFlag("flag3");
     var s = new RevFlagSet { flag1, flag2 };
     a.add(flag3);
     a.add(s);
     Assert.AreEqual(flag1.Mask | flag2.Mask | flag3.Mask, a.Flags);
     a.remove(s);
     Assert.AreEqual(flag3.Mask, a.Flags);
 }
Exemple #47
0
        public virtual void testRemove()
        {
            RevFlag flag1 = rw.newFlag("flag_1");
            RevFlag flag2 = rw.newFlag("flag_2");
            var flagSet = new RevFlagSet();
            Assert.IsTrue(flagSet.Add(flag1));
            Assert.IsTrue(flagSet.Add(flag2));

            Assert.IsTrue(flagSet.Remove(flag1));
            Assert.IsFalse(flagSet.Remove(flag1));
            Assert.AreEqual(flag2.Mask, flagSet.Mask);
            Assert.IsFalse(flagSet.Contains(flag1));
        }
Exemple #48
0
 internal HasAll(RevFlagSet m) : base(m)
 {
 }
Exemple #49
0
		/// <summary>Create a new pack upload for an open repository.</summary>
		/// <remarks>Create a new pack upload for an open repository.</remarks>
		/// <param name="copyFrom">the source repository.</param>
		public UploadPack(Repository copyFrom)
		{
			db = copyFrom;
			walk = new RevWalk(db);
			walk.SetRetainBody(false);
			WANT = walk.NewFlag("WANT");
			PEER_HAS = walk.NewFlag("PEER_HAS");
			COMMON = walk.NewFlag("COMMON");
			SATISFIED = walk.NewFlag("SATISFIED");
			walk.Carry(PEER_HAS);
			SAVE = new RevFlagSet();
			SAVE.AddItem(WANT);
			SAVE.AddItem(PEER_HAS);
			SAVE.AddItem(COMMON);
			SAVE.AddItem(SATISFIED);
		}
Exemple #50
0
        public void testHasAnyFlag()
        {
            RevCommit a = Commit();
            RevFlag flag1 = rw.newFlag("flag1");
            RevFlag flag2 = rw.newFlag("flag2");
            var s = new RevFlagSet { flag1, flag2 };

            Assert.IsFalse(a.hasAny(s));
            a.Flags |= flag1.Mask;
            Assert.IsTrue(a.hasAny(s));
        }
Exemple #51
0
 /// <summary>
 /// Test to see if any flag in the set has been set on this object.
 /// </summary>
 /// <param name="set">the flags to test.</param>
 /// <returns>
 /// true if any flag in the set has been added to this object; false
 /// if not.
 /// </returns>
 public bool hasAny(RevFlagSet set)
 {
     return (Flags & set.Mask) != 0;
 }
Exemple #52
0
 /// <summary>
 /// Remove a set of flags from this object.
 /// </summary>
 /// <param name="set">
 /// The flag to remove from this object.
 /// </param>
 public void remove(RevFlagSet set)
 {
     Flags &= ~set.Mask;
 }
Exemple #53
0
 /**
  * Add a set of flags to this object.
  *
  * @param set
  *            the set of flags to mark on this object, for later testing.
  */
 public void add(RevFlagSet set)
 {
     flags |= set.mask;
 }