Selects interesting revisions during walking. This is an abstract interface. Applications may implement a subclass, or use one of the predefined implementations already available within this package. Filters may be chained together using AndRevFilter and OrRevFilter to create complex boolean expressions. Applications should install the filter on a RevWalk by RevWalk.setRevFilter(RevFilter) prior to starting traversal. Unless specifically noted otherwise a RevFilter implementation is not thread safe and may not be shared by different RevWalk instances at the same time. This restriction allows RevFilter implementations to cache state within their instances during include(RevWalk, RevCommit) if it is beneficial to their implementation. Deep clones created by Clone() may be used to construct a thread-safe copy of an existing filter. Message filters:
  • Author name/email: AuthorRevFilter
  • Committer name/email: CommitterRevFilter
  • Message body: MessageRevFilter
Merge filters:
  • Skip all merges: NO_MERGES.
Boolean modifiers:
  • AND: AndRevFilter
  • OR: OrRevFilter
  • NOT: NotRevFilter
コード例 #1
0
ファイル: AndRevFilter.cs プロジェクト: dev218/GitSharp
		///	<summary>
		/// Create a filter with two filters, both of which must match.
		///	</summary>
		///	<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 Binary(a, b);
		}
コード例 #2
0
 ///	<summary>
 /// Create a filter with two filters, one of which must match.
 ///	</summary>
 ///	<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 Binary(a, b));
 }
コード例 #3
0
            public override RevFilter Clone()
            {
                var s = new RevFilter[_subfilters.Length];

                for (int i = 0; i < s.Length; i++)
                {
                    s[i] = _subfilters[i].Clone();
                }

                return(new List(s));
            }
コード例 #4
0
ファイル: AndRevFilter.cs プロジェクト: dev218/GitSharp
		///	<summary>
		/// Create a filter around many filters, all of which must match.
		///	</summary>
		///	<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("At least two filters needed.");
			}

			var subfilters = new RevFilter[list.Length];
			Array.Copy(list, 0, subfilters, 0, list.Length);
			return new List(subfilters);
		}
コード例 #5
0
        ///	<summary>
        /// Create a filter around many filters, one of which must match.
        ///	</summary>
        ///	<param name="list">
        ///	List of filters to match against. Must contain at least 2
        ///	filters.
        /// </param>
        ///	<returns>
        /// A filter that must match at least one input filter.
        /// </returns>
        public static RevFilter create(RevFilter[] list)
        {
            if (list.Length == 2)
            {
                return(create(list[0], list[1]));
            }

            if (list.Length < 2)
            {
                throw new ArgumentException("At least two filters needed.");
            }

            var subfilters = new RevFilter[list.Length];

            Array.Copy(list, 0, subfilters, 0, list.Length);
            return(new List(subfilters));
        }
コード例 #6
0
 public PendingGenerator(RevWalk w, DateRevQueue p, RevFilter f, GeneratorOutputType outputType)
 {
     _walker = w;
     _pending = p;
     _filter = f;
     _outputType = outputType;
     CanDispose = true;
 }
コード例 #7
0
 internal Binary(RevFilter one, RevFilter two)
 {
     _a = one;
     _b = two;
 }
コード例 #8
0
ファイル: AndRevFilter.cs プロジェクト: dev218/GitSharp
			public override RevFilter Clone()
			{
				var s = new RevFilter[_subfilters.Length];
				for (int i = 0; i < s.Length; i++)
				{
					s[i] = _subfilters[i].Clone();
				}

				return new List(s);
			}
コード例 #9
0
ファイル: AndRevFilter.cs プロジェクト: dev218/GitSharp
			internal List(RevFilter[] list)
			{
				_subfilters = list;
			}
コード例 #10
0
ファイル: AndRevFilter.cs プロジェクト: dev218/GitSharp
			internal Binary(RevFilter one, RevFilter two)
			{
				_a = one;
				_b = two;
			}
コード例 #11
0
ファイル: OrRevFilter.cs プロジェクト: dev218/GitSharp
			public List(RevFilter[] list)
			{
				_subfilters = list;
			}