[repo][controller] Abstract GetCommits method
This commit is contained in:
parent
3efd39d0fc
commit
cb7ba55cf5
|
@ -33,14 +33,9 @@ namespace SparkleLib {
|
||||||
public List <string> MovedFrom;
|
public List <string> MovedFrom;
|
||||||
public List <string> MovedTo;
|
public List <string> 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 <string> ();
|
Edited = new List <string> ();
|
||||||
Added = new List <string> ();
|
Added = new List <string> ();
|
||||||
Deleted = new List <string> ();
|
Deleted = new List <string> ();
|
||||||
|
|
|
@ -971,8 +971,12 @@ namespace SparkleLib {
|
||||||
|
|
||||||
Commit commit = new Commit (this, commit_ref);
|
Commit commit = new Commit (this, commit_ref);
|
||||||
|
|
||||||
SparkleCommit sparkle_commit = new SparkleCommit (commit.Author.Name, commit.Author.EmailAddress,
|
SparkleCommit sparkle_commit = new SparkleCommit ();
|
||||||
commit.CommitDate.DateTime, commit.Hash);
|
|
||||||
|
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) {
|
foreach (Change change in commit.Changes) {
|
||||||
|
|
||||||
|
|
|
@ -204,6 +204,31 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List <ChangeSet> GetLog (string path)
|
||||||
|
{
|
||||||
|
|
||||||
|
int log_size = 30;
|
||||||
|
|
||||||
|
List <ChangeSet> list = new List <ChangeSet> ();
|
||||||
|
|
||||||
|
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
|
// Creates a folder in the user's home folder to store configuration
|
||||||
private void CreateConfigurationFolders ()
|
private void CreateConfigurationFolders ()
|
||||||
{
|
{
|
||||||
|
@ -826,4 +851,9 @@ namespace SparkleShare {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ChangeSet : SparkleCommit {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue