Exemple #1
0
 /// <summary>Create a filter with two filters, one of which must match.</summary>
 /// <remarks>Create a filter with two filters, one of which must match.</remarks>
 /// <param name="a">first filter to test.</param>
 /// <param name="b">second filter to test.</param>
 /// <returns>a filter that must match at least one input filter.</returns>
 public static RevFilter Create(RevFilter a, RevFilter b)
 {
     if (a == ALL || b == ALL)
     {
         return(ALL);
     }
     return(new OrRevFilter.Binary(a, b));
 }
Exemple #2
0
		/// <summary>Create a filter with two filters, one of which must match.</summary>
		/// <remarks>Create a filter with two filters, one of which must match.</remarks>
		/// <param name="a">first filter to test.</param>
		/// <param name="b">second filter to test.</param>
		/// <returns>a filter that must match at least one input filter.</returns>
		public static RevFilter Create(RevFilter a, RevFilter b)
		{
			if (a == ALL || b == ALL)
			{
				return ALL;
			}
			return new OrRevFilter.Binary(a, b);
		}
Exemple #3
0
 public override RevFilter Clone()
 {
     RevFilter[] s = new RevFilter[subfilters.Length];
     for (int i = 0; i < s.Length; i++)
     {
         s[i] = subfilters[i].Clone();
     }
     return(new AndRevFilter.List(s));
 }
Exemple #4
0
 /// <summary>Create a filter with two filters, both of which must match.</summary>
 /// <remarks>Create a filter with two filters, both of which must match.</remarks>
 /// <param name="a">first filter to test.</param>
 /// <param name="b">second filter to test.</param>
 /// <returns>a filter that must match both input filters.</returns>
 public static RevFilter Create(RevFilter a, RevFilter b)
 {
     if (a == ALL)
     {
         return(b);
     }
     if (b == ALL)
     {
         return(a);
     }
     return(new AndRevFilter.Binary(a, b));
 }
Exemple #5
0
		/// <summary>Create a filter with two filters, both of which must match.</summary>
		/// <remarks>Create a filter with two filters, both of which must match.</remarks>
		/// <param name="a">first filter to test.</param>
		/// <param name="b">second filter to test.</param>
		/// <returns>a filter that must match both input filters.</returns>
		public static RevFilter Create(RevFilter a, RevFilter b)
		{
			if (a == ALL)
			{
				return b;
			}
			if (b == ALL)
			{
				return a;
			}
			return new AndRevFilter.Binary(a, b);
		}
Exemple #6
0
 /// <summary>Create a filter around many filters, all of which must match.</summary>
 /// <remarks>Create a filter around many filters, all of which must match.</remarks>
 /// <param name="list">
 /// list of filters to match against. Must contain at least 2
 /// filters.
 /// </param>
 /// <returns>a filter that must match all input filters.</returns>
 public static RevFilter Create(RevFilter[] list)
 {
     if (list.Length == 2)
     {
         return(Create(list[0], list[1]));
     }
     if (list.Length < 2)
     {
         throw new ArgumentException(JGitText.Get().atLeastTwoFiltersNeeded);
     }
     RevFilter[] subfilters = new RevFilter[list.Length];
     System.Array.Copy(list, 0, subfilters, 0, list.Length);
     return(new AndRevFilter.List(subfilters));
 }
Exemple #7
0
 /// <summary>Create a filter around many filters, all of which must match.</summary>
 /// <remarks>Create a filter around many filters, all of which must match.</remarks>
 /// <param name="list">
 /// list of filters to match against. Must contain at least 2
 /// filters.
 /// </param>
 /// <returns>a filter that must match all input filters.</returns>
 public static RevFilter Create(ICollection <RevFilter> list)
 {
     if (list.Count < 2)
     {
         throw new ArgumentException(JGitText.Get().atLeastTwoFiltersNeeded);
     }
     RevFilter[] subfilters = new RevFilter[list.Count];
     Sharpen.Collections.ToArray(list, subfilters);
     if (subfilters.Length == 2)
     {
         return(Create(subfilters[0], subfilters[1]));
     }
     return(new AndRevFilter.List(subfilters));
 }
Exemple #8
0
		/// <summary>Create a filter around many filters, all of which must match.</summary>
		/// <remarks>Create a filter around many filters, all of which must match.</remarks>
		/// <param name="list">
		/// list of filters to match against. Must contain at least 2
		/// filters.
		/// </param>
		/// <returns>a filter that must match all input filters.</returns>
		public static RevFilter Create(RevFilter[] list)
		{
			if (list.Length == 2)
			{
				return Create(list[0], list[1]);
			}
			if (list.Length < 2)
			{
				throw new ArgumentException(JGitText.Get().atLeastTwoFiltersNeeded);
			}
			RevFilter[] subfilters = new RevFilter[list.Length];
			System.Array.Copy(list, 0, subfilters, 0, list.Length);
			return new AndRevFilter.List(subfilters);
		}
Exemple #9
0
 internal Binary(RevFilter one, RevFilter two)
 {
     a = one;
     b = two;
     requiresCommitBody = a.RequiresCommitBody() || b.RequiresCommitBody();
 }
		private static RevFilter ApplyNoMergesFilter(RevFilter filter)
		{
			return AndRevFilter.Create(new[] {RevFilter.NO_MERGES, filter});
		}
 private NotRevFilter(RevFilter one)
 {
     a = one;
 }
		internal PendingGenerator(RevWalk w, DateRevQueue p, RevFilter f, int @out)
		{
			walker = w;
			pending = p;
			filter = f;
			output = @out;
			canDispose = true;
		}
		private NotRevFilter(RevFilter one)
		{
			a = one;
		}
 /// <summary>Create a filter that negates the result of another filter.</summary>
 /// <remarks>Create a filter that negates the result of another filter.</remarks>
 /// <param name="a">filter to negate.</param>
 /// <returns>a filter that does the reverse of <code>a</code>.</returns>
 public static RevFilter Create(RevFilter a)
 {
     return(new NGit.Revwalk.Filter.NotRevFilter(a));
 }
			internal List(RevFilter[] list)
			{
				subfilters = list;
			}
Exemple #16
0
		/// <summary>Create a filter around many filters, all of which must match.</summary>
		/// <remarks>Create a filter around many filters, all of which must match.</remarks>
		/// <param name="list">
		/// list of filters to match against. Must contain at least 2
		/// filters.
		/// </param>
		/// <returns>a filter that must match all input filters.</returns>
		public static RevFilter Create(ICollection<RevFilter> list)
		{
			if (list.Count < 2)
			{
				throw new ArgumentException(JGitText.Get().atLeastTwoFiltersNeeded);
			}
			RevFilter[] subfilters = new RevFilter[list.Count];
			Sharpen.Collections.ToArray(list, subfilters);
			if (subfilters.Length == 2)
			{
				return Create(subfilters[0], subfilters[1]);
			}
			return new AndRevFilter.List(subfilters);
		}
Exemple #17
0
			internal Binary(RevFilter one, RevFilter two)
			{
				a = one;
				b = two;
				requiresCommitBody = a.RequiresCommitBody() || b.RequiresCommitBody();
			}
Exemple #18
0
			public override RevFilter Clone()
			{
				RevFilter[] s = new RevFilter[subfilters.Length];
				for (int i = 0; i < s.Length; i++)
				{
					s[i] = subfilters[i].Clone();
				}
				return new AndRevFilter.List(s);
			}
Exemple #19
0
			internal List(RevFilter[] list)
			{
				subfilters = list;
				bool rcb = false;
				foreach (RevFilter filter in subfilters)
				{
					rcb |= filter.RequiresCommitBody();
				}
				requiresCommitBody = rcb;
			}
		/// <summary>Create a filter that negates the result of another filter.</summary>
		/// <remarks>Create a filter that negates the result of another filter.</remarks>
		/// <param name="a">filter to negate.</param>
		/// <returns>a filter that does the reverse of <code>a</code>.</returns>
		public static RevFilter Create(RevFilter a)
		{
			return new NGit.Revwalk.Filter.NotRevFilter(a);
		}
			internal Binary(RevFilter one, RevFilter two)
			{
				a = one;
				b = two;
			}