repo: move changeset list creation logic to base class
This commit is contained in:
parent
36e5658783
commit
d812c4c146
|
@ -265,7 +265,6 @@ namespace SparkleLib.Git {
|
||||||
git.WaitForExit ();
|
git.WaitForExit ();
|
||||||
|
|
||||||
UpdateSizes ();
|
UpdateSizes ();
|
||||||
ChangeSets = GetChangeSets ();
|
|
||||||
|
|
||||||
if (git.ExitCode == 0) {
|
if (git.ExitCode == 0) {
|
||||||
ClearCache ();
|
ClearCache ();
|
||||||
|
@ -337,13 +336,11 @@ namespace SparkleLib.Git {
|
||||||
string identifier_file_path = Path.Combine (LocalPath, ".sparkleshare");
|
string identifier_file_path = Path.Combine (LocalPath, ".sparkleshare");
|
||||||
File.SetAttributes (identifier_file_path, FileAttributes.Hidden);
|
File.SetAttributes (identifier_file_path, FileAttributes.Hidden);
|
||||||
|
|
||||||
ChangeSets = GetChangeSets ();
|
|
||||||
ClearCache ();
|
ClearCache ();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ChangeSets = GetChangeSets ();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -282,10 +282,11 @@ namespace SparkleLib {
|
||||||
|
|
||||||
if (SyncUp ()) {
|
if (SyncUp ()) {
|
||||||
SparkleHelpers.DebugInfo ("SyncUp", Name + " | Done");
|
SparkleHelpers.DebugInfo ("SyncUp", Name + " | Done");
|
||||||
|
|
||||||
HasUnsyncedChanges = false;
|
HasUnsyncedChanges = false;
|
||||||
SyncStatusChanged (SyncStatus.Idle);
|
|
||||||
|
|
||||||
|
ChangeSets = GetChangeSets ();
|
||||||
|
|
||||||
|
SyncStatusChanged (SyncStatus.Idle);
|
||||||
this.listener.Announce (new SparkleAnnouncement (Identifier, CurrentRevision));
|
this.listener.Announce (new SparkleAnnouncement (Identifier, CurrentRevision));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -320,21 +321,20 @@ namespace SparkleLib {
|
||||||
SparkleHelpers.DebugInfo ("SyncDown", Name + " | Done");
|
SparkleHelpers.DebugInfo ("SyncDown", Name + " | Done");
|
||||||
ServerOnline = true;
|
ServerOnline = true;
|
||||||
|
|
||||||
if (!pre_sync_revision.Equals (CurrentRevision)) {
|
ChangeSets = GetChangeSets ();
|
||||||
if (ChangeSets != null &&
|
|
||||||
ChangeSets.Count > 0) {
|
|
||||||
|
|
||||||
bool emit_change_event = true;
|
if (!pre_sync_revision.Equals (CurrentRevision) && ChangeSets != null && ChangeSets.Count > 0) {
|
||||||
foreach (SparkleChange change in ChangeSets [0].Changes) {
|
bool emit_change_event = true;
|
||||||
if (change.Path.EndsWith (".sparkleshare")) {
|
|
||||||
emit_change_event = false;
|
foreach (SparkleChange change in ChangeSets [0].Changes) {
|
||||||
break;
|
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
|
// There could be changes from a resolved
|
||||||
|
@ -353,6 +353,8 @@ namespace SparkleLib {
|
||||||
SparkleHelpers.DebugInfo ("SyncDown", Name + " | Error");
|
SparkleHelpers.DebugInfo ("SyncDown", Name + " | Error");
|
||||||
ServerOnline = false;
|
ServerOnline = false;
|
||||||
|
|
||||||
|
ChangeSets = GetChangeSets ();
|
||||||
|
|
||||||
SyncStatusChanged (SyncStatus.Error);
|
SyncStatusChanged (SyncStatus.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue