Fix bug where large amounts of files aren't being added/commited/pushed (process class hung on the large outputs)
This commit is contained in:
parent
3c3c801083
commit
bc79205308
|
@ -128,12 +128,11 @@ namespace SparkleLib {
|
||||||
public override bool SyncUp ()
|
public override bool SyncUp ()
|
||||||
{
|
{
|
||||||
Add ();
|
Add ();
|
||||||
|
Commit ("Changes made by SparkleShare");
|
||||||
string message = FormatCommitMessage ();
|
|
||||||
Commit (message);
|
|
||||||
|
|
||||||
SparkleGit git = new SparkleGit (LocalPath, "push origin master");
|
SparkleGit git = new SparkleGit (LocalPath, "push origin master");
|
||||||
git.Start ();
|
git.Start ();
|
||||||
|
git.StandardOutput.ReadToEnd ();
|
||||||
git.WaitForExit ();
|
git.WaitForExit ();
|
||||||
|
|
||||||
if (git.ExitCode == 0)
|
if (git.ExitCode == 0)
|
||||||
|
@ -228,11 +227,9 @@ namespace SparkleLib {
|
||||||
// Commits the made changes
|
// Commits the made changes
|
||||||
private void Commit (string message)
|
private void Commit (string message)
|
||||||
{
|
{
|
||||||
if (!AnyDifferences)
|
|
||||||
return;
|
|
||||||
|
|
||||||
SparkleGit git = new SparkleGit (LocalPath, "commit -m \"" + message + "\"");
|
SparkleGit git = new SparkleGit (LocalPath, "commit -m \"" + message + "\"");
|
||||||
git.Start ();
|
git.Start ();
|
||||||
|
git.StandardOutput.ReadToEnd ();
|
||||||
git.WaitForExit ();
|
git.WaitForExit ();
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Commit", "[" + Name + "] " + message);
|
SparkleHelpers.DebugInfo ("Commit", "[" + Name + "] " + message);
|
||||||
|
@ -268,7 +265,6 @@ namespace SparkleLib {
|
||||||
ResolveConflict ();
|
ResolveConflict ();
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Conflict resolved.");
|
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Conflict resolved.");
|
||||||
|
|
||||||
OnConflictResolved ();
|
OnConflictResolved ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,6 +276,7 @@ namespace SparkleLib {
|
||||||
{
|
{
|
||||||
lock (this.change_lock) {
|
lock (this.change_lock) {
|
||||||
if (this.has_changed) {
|
if (this.has_changed) {
|
||||||
|
Console.WriteLine ("checking...");
|
||||||
if (this.sizebuffer.Count >= 4)
|
if (this.sizebuffer.Count >= 4)
|
||||||
this.sizebuffer.RemoveAt (0);
|
this.sizebuffer.RemoveAt (0);
|
||||||
|
|
||||||
|
@ -317,6 +318,10 @@ namespace SparkleLib {
|
||||||
if (AnyDifferences) {
|
if (AnyDifferences) {
|
||||||
this.is_buffering = true;
|
this.is_buffering = true;
|
||||||
|
|
||||||
|
// We want to disable wathcing temporarily, but
|
||||||
|
// not stop the local timer
|
||||||
|
this.watcher.EnableRaisingEvents = false;
|
||||||
|
|
||||||
// Only fire the event if the timer has been stopped.
|
// Only fire the event if the timer has been stopped.
|
||||||
// This prevents multiple events from being raised whilst "buffering".
|
// This prevents multiple events from being raised whilst "buffering".
|
||||||
if (!this.has_changed) {
|
if (!this.has_changed) {
|
||||||
|
|
Loading…
Reference in a new issue