event log: show the last month worth of changes

This commit is contained in:
Hylke Bons 2012-10-16 11:03:20 +01:00
parent 423717bd1d
commit 2c94a9938d
3 changed files with 8 additions and 18 deletions

View file

@ -598,21 +598,15 @@ namespace SparkleLib.Git {
} }
public override List<SparkleChangeSet> GetChangeSets (string path, int count) public override List<SparkleChangeSet> GetChangeSets (string path)
{ {
return GetChangeSetsInternal (path, count); return GetChangeSetsInternal (path);
} }
public override List<SparkleChangeSet> GetChangeSets (int count)
{
return GetChangeSetsInternal (null, count);
}
public override List<SparkleChangeSet> GetChangeSets () public override List<SparkleChangeSet> GetChangeSets ()
{ {
return GetChangeSetsInternal (null, 150); return GetChangeSetsInternal (null);
} }
@ -642,22 +636,19 @@ namespace SparkleLib.Git {
} }
private List<SparkleChangeSet> GetChangeSetsInternal (string path, int count) private List<SparkleChangeSet> GetChangeSetsInternal (string path)
{ {
if (count < 1)
throw new ArgumentOutOfRangeException ("count");
List <SparkleChangeSet> change_sets = new List <SparkleChangeSet> (); List <SparkleChangeSet> change_sets = new List <SparkleChangeSet> ();
SparkleGit git; SparkleGit git;
if (path == null) { if (path == null) {
git = new SparkleGit (LocalPath, "log -" + count + " --raw --find-renames --date=iso " + git = new SparkleGit (LocalPath, "log --since=1.month --raw --find-renames --date=iso " +
"--format=medium --no-color --no-merges"); "--format=medium --no-color --no-merges");
} else { } else {
path = path.Replace ("\\", "/"); path = path.Replace ("\\", "/");
git = new SparkleGit (LocalPath, "log -" + count + " --raw --find-renames --date=iso " + git = new SparkleGit (LocalPath, "log --raw --find-renames --date=iso " +
"--format=medium --no-color --no-merges -- \"" + path + "\""); "--format=medium --no-color --no-merges -- \"" + path + "\"");
} }

View file

@ -55,8 +55,7 @@ namespace SparkleLib {
public abstract bool SyncUp (); public abstract bool SyncUp ();
public abstract bool SyncDown (); public abstract bool SyncDown ();
public abstract List<SparkleChangeSet> GetChangeSets (); public abstract List<SparkleChangeSet> GetChangeSets ();
public abstract List<SparkleChangeSet> GetChangeSets (int count); public abstract List<SparkleChangeSet> GetChangeSets (string path);
public abstract List<SparkleChangeSet> GetChangeSets (string path, int count);
public abstract void RestoreFile (string path, string revision, string target_file_path); public abstract void RestoreFile (string path, string revision, string target_file_path);
public event SyncStatusChangedEventHandler SyncStatusChanged = delegate { }; public event SyncStatusChangedEventHandler SyncStatusChanged = delegate { };

View file

@ -288,7 +288,7 @@ namespace SparkleShare {
Stopwatch watch = new Stopwatch (); Stopwatch watch = new Stopwatch ();
watch.Start (); watch.Start ();
List<SparkleChangeSet> change_sets = repo.GetChangeSets (file_path, 100); List<SparkleChangeSet> change_sets = repo.GetChangeSets (file_path);
string html = GetHistoryHTMLLog (change_sets, file_path); string html = GetHistoryHTMLLog (change_sets, file_path);
watch.Stop (); watch.Stop ();