From 17b614121c0567ed10f25fc757bf8d1bf68c1f06 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 14 May 2011 03:18:38 +0100 Subject: [PATCH] repo: push changes after resolving a conflict --- SparkleLib/SparkleRepo.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index 08972064..e1b8d5e7 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -585,17 +585,19 @@ namespace SparkleLib { git.Exited += delegate { if (git.ExitCode != 0) { SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Conflict detected. Trying to get out..."); - this.watcher.EnableRaisingEvents = false; + DisableWatching (); while (AnyDifferences) ResolveConflict (); SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Conflict resolved."); - this.watcher.EnableRaisingEvents = true; + EnableWatching (); SparkleEventArgs args = new SparkleEventArgs ("ConflictDetected"); if (ConflictDetected != null) ConflictDetected (this, args); + + Push (); } this.current_hash = GetCurrentHash (); @@ -773,6 +775,18 @@ namespace SparkleLib { } + public void DisableWatching () + { + this.watcher.EnableRaisingEvents = false; + } + + + public void EnableWatching () + { + this.watcher.EnableRaisingEvents = true; + } + + // Gets the domain name of a given URL private string GetDomain (string url) {