Permalink
Browse files

Rename CommitCollection to CommitLog

  • Loading branch information...
1 parent 68fb1c7 commit d422a6ee2e7e461f55ee860b055bbe2713241280 @dahlbyk dahlbyk committed Jun 8, 2012
View
2 LibGit2Sharp.Tests/CommitFixture.cs
@@ -341,7 +341,7 @@ private static void AssertEnumerationOfCommits(Func<Repository, Filter> filterBu
private static void AssertEnumerationOfCommitsInRepo(Repository repo, Func<Repository, Filter> filterBuilder, IEnumerable<string> abbrevIds)
{
- ICommitCollection commits = repo.Commits.QueryBy(filterBuilder(repo));
+ ICommitLog commits = repo.Commits.QueryBy(filterBuilder(repo));
IEnumerable<string> commitShas = commits.Select(c => c.Id.ToString(7)).ToArray();
View
2 LibGit2Sharp/Branch.cs
@@ -125,7 +125,7 @@ public Commit Tip
/// <summary>
/// Gets the commits on this branch. (Starts walking from the References's target).
/// </summary>
- public ICommitCollection Commits
+ public ICommitLog Commits
{
get { return repo.Commits.QueryBy(new Filter { Since = this }); }
}
View
28 LibGit2Sharp/CommitCollection.cs → LibGit2Sharp/CommitLog.cs
@@ -9,38 +9,38 @@
namespace LibGit2Sharp
{
/// <summary>
- /// A collection of commits in a <see cref = "Repository" />
+ /// A log of commits in a <see cref = "Repository" />
/// </summary>
- public class CommitCollection : IQueryableCommitCollection
+ public class CommitLog : IQueryableCommitLog
{
private readonly Repository repo;
private IList<object> includedIdentifier = new List<object> { "HEAD" };
private IList<object> excludedIdentifier = new List<object>();
private readonly GitSortOptions sortOptions;
/// <summary>
- /// Initializes a new instance of the <see cref = "CommitCollection" /> class.
+ /// Initializes a new instance of the <see cref = "CommitLog" /> class.
/// The commits will be enumerated according in reverse chronological order.
/// </summary>
/// <param name = "repo">The repository.</param>
- internal CommitCollection(Repository repo)
+ internal CommitLog(Repository repo)
: this(repo, GitSortOptions.Time)
{
}
/// <summary>
- /// Initializes a new instance of the <see cref = "CommitCollection" /> class.
+ /// Initializes a new instance of the <see cref = "CommitLog" /> class.
/// </summary>
/// <param name = "repo">The repository.</param>
/// <param name = "sortingStrategy">The sorting strategy which should be applied when enumerating the commits.</param>
- internal CommitCollection(Repository repo, GitSortOptions sortingStrategy)
+ internal CommitLog(Repository repo, GitSortOptions sortingStrategy)
{
this.repo = repo;
sortOptions = sortingStrategy;
}
/// <summary>
- /// Gets the current sorting strategy applied when enumerating the collection
+ /// Gets the current sorting strategy applied when enumerating the log
/// </summary>
public GitSortOptions SortedBy
{
@@ -50,9 +50,9 @@ public GitSortOptions SortedBy
#region IEnumerable<Commit> Members
/// <summary>
- /// Returns an enumerator that iterates through the collection.
+ /// Returns an enumerator that iterates through the log.
/// </summary>
- /// <returns>An <see cref = "IEnumerator{T}" /> object that can be used to iterate through the collection.</returns>
+ /// <returns>An <see cref = "IEnumerator{T}" /> object that can be used to iterate through the log.</returns>
public IEnumerator<Commit> GetEnumerator()
{
if ((repo.Info.IsEmpty) && includedIdentifier.Any(o => PointsAtTheHead(o.ToString()))) // TODO: ToString() == fragile
@@ -64,9 +64,9 @@ public IEnumerator<Commit> GetEnumerator()
}
/// <summary>
- /// Returns an enumerator that iterates through the collection.
+ /// Returns an enumerator that iterates through the log.
/// </summary>
- /// <returns>An <see cref = "IEnumerator" /> object that can be used to iterate through the collection.</returns>
+ /// <returns>An <see cref = "IEnumerator" /> object that can be used to iterate through the log.</returns>
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
@@ -78,14 +78,14 @@ IEnumerator IEnumerable.GetEnumerator()
/// 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 collection of commits, ready to be enumerated.</returns>
- public ICommitCollection QueryBy(Filter filter)
+ /// <returns>A list of commits, ready to be enumerated.</returns>
+ public ICommitLog QueryBy(Filter filter)
{
Ensure.ArgumentNotNull(filter, "filter");
Ensure.ArgumentNotNull(filter.Since, "filter.Since");
Ensure.ArgumentNotNullOrEmptyString(filter.Since.ToString(), "filter.Since");
- return new CommitCollection(repo, filter.SortBy)
+ return new CommitLog(repo, filter.SortBy)
{
includedIdentifier = ToList(filter.Since),
excludedIdentifier = ToList(filter.Until)
View
12 LibGit2Sharp/ICommitCollection.cs → LibGit2Sharp/ICommitLog.cs
@@ -1,14 +1,22 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
namespace LibGit2Sharp
{
/// <summary>
+ /// A log of commits in a <see cref = "Repository" />.
+ /// </summary>
+ public interface ICommitLog : ICommitCollection
+ { }
+
+ /// <summary>
/// A collection of commits in a <see cref = "Repository" />.
/// </summary>
+ [Obsolete("This interface will be removed in the next release. Please use ICommitLog instead.")]
public interface ICommitCollection : IEnumerable<Commit>
{
/// <summary>
- /// Gets the current sorting strategy applied when enumerating the collection.
+ /// Gets the current sorting strategy applied when enumerating the log.
/// </summary>
GitSortOptions SortedBy { get; }
}
View
13 LibGit2Sharp/IQueryableCommitCollection.cs → LibGit2Sharp/IQueryableCommitLog.cs
@@ -4,16 +4,23 @@
namespace LibGit2Sharp
{
/// <summary>
+ /// A log of commits in a <see cref = "Repository" /> that can be filtered with queries.
+ /// </summary>
+ public interface IQueryableCommitLog : ICommitLog, IQueryableCommitCollection
+ { }
+
+ /// <summary>
/// A collection of commits in a <see cref = "Repository" /> that can be filtered with queries.
/// </summary>
- public interface IQueryableCommitCollection : ICommitCollection //TODO: Find a name that's more explicit than IQueryableCommitCollection
+ [Obsolete("This interface will be removed in the next release. Please use IQueryableCommitLog instead.")]
+ public interface IQueryableCommitCollection : ICommitCollection
{
/// <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 collection of commits, ready to be enumerated.</returns>
- ICommitCollection QueryBy(Filter filter);
+ /// <returns>A list of commits, ready to be enumerated.</returns>
+ ICommitLog QueryBy(Filter filter);
/// <summary>
/// Stores the content of the <see cref = "Repository.Index" /> as a new <see cref = "Commit" /> into the repository.
View
6 LibGit2Sharp/LibGit2Sharp.csproj
@@ -61,7 +61,7 @@
<Compile Include="BranchCollection.cs" />
<Compile Include="Changes.cs" />
<Compile Include="Commit.cs" />
- <Compile Include="CommitCollection.cs" />
+ <Compile Include="CommitLog.cs" />
<Compile Include="Configuration.cs" />
<Compile Include="ContentChanges.cs" />
<Compile Include="Core\Compat\Environment.cs" />
@@ -130,12 +130,12 @@
<Compile Include="GitSortOptions.cs" />
<Compile Include="Core\LambdaEqualityHelper.cs" />
<Compile Include="Core\Libgit2UnsafeHelper.cs" />
- <Compile Include="ICommitCollection.cs" />
+ <Compile Include="ICommitLog.cs" />
<Compile Include="Index.cs" />
<Compile Include="IndexEntry.cs" />
<Compile Include="Core\Handles\IndexSafeHandle.cs" />
<Compile Include="Filter.cs" />
- <Compile Include="IQueryableCommitCollection.cs" />
+ <Compile Include="IQueryableCommitLog.cs" />
<Compile Include="Core\LookUpOptions.cs" />
<Compile Include="Mode.cs" />
<Compile Include="ObjectDatabase.cs" />
View
6 LibGit2Sharp/Repository.cs
@@ -16,7 +16,7 @@ namespace LibGit2Sharp
public class Repository : IDisposable
{
private readonly BranchCollection branches;
- private readonly CommitCollection commits;
+ private readonly CommitLog commits;
private readonly Lazy<Configuration> config;
private readonly RepositorySafeHandle handle;
private readonly Index index;
@@ -86,7 +86,7 @@ public Repository(string path, RepositoryOptions options = null)
index = indexBuilder();
}
- commits = new CommitCollection(this);
+ commits = new CommitLog(this);
refs = new ReferenceCollection(this);
branches = new BranchCollection(this);
tags = new TagCollection(this);
@@ -185,7 +185,7 @@ public RemoteCollection Remotes
/// Lookup and enumerate commits in the repository.
/// Iterating this collection directly starts walking from the HEAD.
/// </summary>
- public IQueryableCommitCollection Commits
+ public IQueryableCommitLog Commits
{
get { return commits; }
}

0 comments on commit d422a6e

Please sign in to comment.