Merge pull request #72 from Cyberboss/NoCompileMessageOnTestmerge

Brings update messages more inline with TGS2
This commit is contained in:
Jordan Brown
2017-06-23 11:11:56 -04:00
committed by GitHub
4 changed files with 25 additions and 8 deletions
+15 -3
View File
@@ -48,6 +48,7 @@ namespace TGServerService
Thread CompilerThread;
bool compilationCancellationRequestation = false;
bool canCancelCompilation = false;
bool silentCompile = false;
bool UpdateStaged = false;
@@ -199,6 +200,7 @@ namespace TGServerService
lock (CompilerLock)
{
compilerCurrentStatus = TGCompilerStatus.Compiling;
silentCompile = true;
}
}
catch (ThreadAbortException)
@@ -288,7 +290,16 @@ namespace TGServerService
compilerCurrentStatus = TGCompilerStatus.Initialized;
return;
}
SendMessage("DM: Compiling...");
bool silent;
lock (CompilerLock)
{
silent = silentCompile;
silentCompile = false;
}
if(!silent)
SendMessage("DM: Compiling...");
var resurrectee = GetStagingDir();
Program.DeleteDirectory(resurrectee, true, deleteExcludeList);
@@ -496,7 +507,7 @@ namespace TGServerService
{
compilerCurrentStatus = TGCompilerStatus.Initialized;
compilationCancellationRequestation = false;
SendMessage("Compile cancelled!");
SendMessage("DM: Compile cancelled!");
TGServerService.WriteInfo("Compilation cancelled", TGServerService.EventID.DMCompileCancel);
}
}
@@ -504,12 +515,13 @@ namespace TGServerService
}
//kicks off the compiler thread
//public api
public bool Compile()
public bool Compile(bool silent = false)
{
lock (CompilerLock)
{
if (compilerCurrentStatus != TGCompilerStatus.Initialized)
return false;
silentCompile = silent;
lastCompilerError = null;
compilerCurrentStatus = TGCompilerStatus.Compiling;
CompilerThread = new Thread(new ThreadStart(CompileImpl));
+2 -2
View File
@@ -56,7 +56,7 @@ namespace TGServerService
if (testmerge_pr != 0)
{
res = MergePullRequest(testmerge_pr);
res = MergePullRequestImpl(testmerge_pr, true);
if (res != null && res != RepoErrorUpToDate)
return res;
}
@@ -75,7 +75,7 @@ namespace TGServerService
return res;
}
if (!Compile())
if (!Compile(true))
return "Compilation could not be started!";
return null;
}
+5 -1
View File
@@ -508,13 +508,17 @@ namespace TGServerService
//public api
public string MergePullRequest(int PRNumber)
{
return MergePullRequestImpl(PRNumber, false);
}
string MergePullRequestImpl(int PRNumber, bool impliedUpdate)
{
lock (RepoLock)
{
var result = LoadRepo();
if (result != null)
return result;
SendMessage(String.Format("REPO: Merging PR #{0}...", PRNumber));
SendMessage(String.Format("REPO: {2}erging PR #{0}...", PRNumber, impliedUpdate ? "Test m" : "M"));
try
{
//only supported with github
+3 -2
View File
@@ -42,16 +42,17 @@ namespace TGServiceInterface
/// <returns>true if the operation began, false if it could not start</returns>
[OperationContract]
bool Initialize();
/// <summary>
/// Does all the necessary actions to take the revision currently in the repository
/// and compile it to be run on the next server reboot
/// requires byond to be set up and the compiler to be initialized
/// runs asyncronously
/// </summary>
/// <param name="silent">If true no message for compilation start will be printed</param>
/// <returns>true if the operation began, false if it could not start</returns>
[OperationContract]
bool Compile();
bool Compile(bool silent = false);
/// <summary>
/// Cancels the current compilation