本文整理汇总了C#中RevFlagSet.Add方法的典型用法代码示例。如果您正苦于以下问题:C# RevFlagSet.Add方法的具体用法?C# RevFlagSet.Add怎么用?C# RevFlagSet.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevFlagSet
的用法示例。
在下文中一共展示了RevFlagSet.Add方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: testAddTwo
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);
}
示例2: hasAll
/**
* 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);
}
示例3: testAddOne
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());
}
示例4: UploadPack
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);
}
示例5: testContainsAll
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));
}
示例6: testRemove
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));
}
示例7: testEquals
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));
}
示例8: has
/**
* Create a new filter that tests for a single flag.
*
* @param a
* the flag to test.
* @return filter that selects only commits with flag <code>a</code>.
*/
public static RevFilter has(RevFlag a)
{
RevFlagSet s = new RevFlagSet();
s.Add(a);
return new HasAll(s);
}
示例9: hasAny
/// <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);
}