From 2c94a9938d652648dba7b36d6e39a9c009cc6c44 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 16 Oct 2012 11:03:20 +0100 Subject: [PATCH] event log: show the last month worth of changes --- SparkleLib/Git/SparkleRepoGit.cs | 21 ++++++--------------- SparkleLib/SparkleRepoBase.cs | 3 +-- SparkleShare/SparkleEventLogController.cs | 2 +- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 63cb459e..d938887a 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -598,21 +598,15 @@ namespace SparkleLib.Git { } - public override List GetChangeSets (string path, int count) + public override List GetChangeSets (string path) { - return GetChangeSetsInternal (path, count); + return GetChangeSetsInternal (path); } - - public override List GetChangeSets (int count) - { - return GetChangeSetsInternal (null, count); - } - public override List GetChangeSets () { - return GetChangeSetsInternal (null, 150); + return GetChangeSetsInternal (null); } @@ -642,22 +636,19 @@ namespace SparkleLib.Git { } - private List GetChangeSetsInternal (string path, int count) + private List GetChangeSetsInternal (string path) { - if (count < 1) - throw new ArgumentOutOfRangeException ("count"); - List change_sets = new List (); SparkleGit git; 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"); } else { 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 + "\""); } diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 951c62bf..a739688e 100755 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -55,8 +55,7 @@ namespace SparkleLib { public abstract bool SyncUp (); public abstract bool SyncDown (); public abstract List GetChangeSets (); - public abstract List GetChangeSets (int count); - public abstract List GetChangeSets (string path, int count); + public abstract List GetChangeSets (string path); public abstract void RestoreFile (string path, string revision, string target_file_path); public event SyncStatusChangedEventHandler SyncStatusChanged = delegate { }; diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index 8f7dfacc..1c90753d 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -288,7 +288,7 @@ namespace SparkleShare { Stopwatch watch = new Stopwatch (); watch.Start (); - List change_sets = repo.GetChangeSets (file_path, 100); + List change_sets = repo.GetChangeSets (file_path); string html = GetHistoryHTMLLog (change_sets, file_path); watch.Stop ();