diff --git a/SparkleLib/SparkleCommit.cs b/SparkleLib/SparkleCommit.cs index 8c71c2e7..77449b30 100644 --- a/SparkleLib/SparkleCommit.cs +++ b/SparkleLib/SparkleCommit.cs @@ -33,14 +33,9 @@ namespace SparkleLib { public List MovedFrom; public List MovedTo; - public SparkleCommit (string user_name, string user_email, DateTime date_time, string hash) + public SparkleCommit () { - UserName = user_name; - UserEmail = user_email; - DateTime = date_time; - Hash = hash; - Edited = new List (); Added = new List (); Deleted = new List (); diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index ed924948..a262ce25 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -971,9 +971,13 @@ namespace SparkleLib { Commit commit = new Commit (this, commit_ref); - SparkleCommit sparkle_commit = new SparkleCommit (commit.Author.Name, commit.Author.EmailAddress, - commit.CommitDate.DateTime, commit.Hash); + SparkleCommit sparkle_commit = new SparkleCommit (); + sparkle_commit.UserName = commit.Author.Name; + sparkle_commit.UserEmail = commit.Author.EmailAddress; + sparkle_commit.DateTime = commit.CommitDate.DateTime; + sparkle_commit.Hash = commit.Hash; + foreach (Change change in commit.Changes) { if (change.ChangeType.ToString ().Equals ("Added")) diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index a90fdb69..5eb7fc70 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -204,6 +204,31 @@ namespace SparkleShare { } + public List GetLog (string path) + { + + int log_size = 30; + + List list = new List (); + + foreach (SparkleRepo repo in Repositories) { + + if (repo.LocalPath.Equals (path)) { + + foreach (SparkleCommit commit in repo.GetCommits (log_size)) + list.Add ((ChangeSet) commit); + + return list; + + } + + } + + return null; + + } + + // Creates a folder in the user's home folder to store configuration private void CreateConfigurationFolders () { @@ -826,4 +851,9 @@ namespace SparkleShare { } + + public class ChangeSet : SparkleCommit { + + } + } \ No newline at end of file