Example #1
0
        /// <summary>
        /// Returns the list of commits of the repository representing the history of a file beyond renames.
        /// </summary>
        /// <param name="path">The file's path.</param>
        /// <param name="filter">The options used to control which commits will be returned.</param>
        /// <returns>A list of file history entries, ready to be enumerated.</returns>
        public IEnumerable <LogEntry> QueryBy(string path, CommitFilter filter)
        {
            Ensure.ArgumentNotNull(path, "path");
            Ensure.ArgumentNotNull(filter, "filter");

            return(new FileHistory(repo, path, filter));
        }
Example #2
0
        /// <summary>
        /// Returns the list of commits of the repository matching the specified <paramref name="filter"/>.
        /// </summary>
        /// <param name="filter">The options used to control which commits will be returned.</param>
        /// <returns>A list of commits, ready to be enumerated.</returns>
        public ICommitLog QueryBy(CommitFilter filter)
        {
            Ensure.ArgumentNotNull(filter, "filter");
            Ensure.ArgumentNotNull(filter.IncludeReachableFrom, "filter.IncludeReachableFrom");
            Ensure.ArgumentNotNullOrEmptyString(filter.IncludeReachableFrom.ToString(), "filter.IncludeReachableFrom");

            return(new CommitLog(repo, filter));
        }
Example #3
0
            public CommitEnumerator(Repository repo, CommitFilter filter)
            {
                this.repo = repo;
                handle    = Proxy.git_revwalk_new(repo.Handle);
                repo.RegisterForCleanup(handle);

                Sort(filter.SortBy);
                Push(filter.SinceList);
                Hide(filter.UntilList);
                FirstParentOnly(filter.FirstParentOnly);
            }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommitLog"/> class.
 /// </summary>
 /// <param name="repo">The repository.</param>
 /// <param name="queryFilter">The filter to use in querying commits</param>
 internal CommitLog(Repository repo, CommitFilter queryFilter)
 {
     this.repo        = repo;
     this.queryFilter = queryFilter;
 }