repo: move changeset list creation logic to base class

This commit is contained in:
Hylke Bons 2012-07-19 22:21:38 +02:00
parent 32848f8772
commit 126d696d5a
2 changed files with 16 additions and 17 deletions

View file

@ -265,7 +265,6 @@ namespace SparkleLib.Git {
git.WaitForExit ();
UpdateSizes ();
ChangeSets = GetChangeSets ();
if (git.ExitCode == 0) {
ClearCache ();
@ -337,13 +336,11 @@ namespace SparkleLib.Git {
string identifier_file_path = Path.Combine (LocalPath, ".sparkleshare");
File.SetAttributes (identifier_file_path, FileAttributes.Hidden);
ChangeSets = GetChangeSets ();
ClearCache ();
return true;
} else {
ChangeSets = GetChangeSets ();
return false;
}
}

View file

@ -282,10 +282,11 @@ namespace SparkleLib {
if (SyncUp ()) {
SparkleHelpers.DebugInfo ("SyncUp", Name + " | Done");
HasUnsyncedChanges = false;
SyncStatusChanged (SyncStatus.Idle);
ChangeSets = GetChangeSets ();
SyncStatusChanged (SyncStatus.Idle);
this.listener.Announce (new SparkleAnnouncement (Identifier, CurrentRevision));
} else {
@ -320,21 +321,20 @@ namespace SparkleLib {
SparkleHelpers.DebugInfo ("SyncDown", Name + " | Done");
ServerOnline = true;
if (!pre_sync_revision.Equals (CurrentRevision)) {
if (ChangeSets != null &&
ChangeSets.Count > 0) {
ChangeSets = GetChangeSets ();
bool emit_change_event = true;
foreach (SparkleChange change in ChangeSets [0].Changes) {
if (change.Path.EndsWith (".sparkleshare")) {
emit_change_event = false;
break;
}
if (!pre_sync_revision.Equals (CurrentRevision) && ChangeSets != null && ChangeSets.Count > 0) {
bool emit_change_event = true;
foreach (SparkleChange change in ChangeSets [0].Changes) {
if (change.Path.EndsWith (".sparkleshare")) {
emit_change_event = false;
break;
}
if (emit_change_event)
NewChangeSet (ChangeSets [0]);
}
if (emit_change_event)
NewChangeSet (ChangeSets [0]);
}
// There could be changes from a resolved
@ -353,6 +353,8 @@ namespace SparkleLib {
SparkleHelpers.DebugInfo ("SyncDown", Name + " | Error");
ServerOnline = false;
ChangeSets = GetChangeSets ();
SyncStatusChanged (SyncStatus.Error);
}