diff --git a/TGServerService/RepoConfig.cs b/TGServerService/RepoConfig.cs
new file mode 100644
index 0000000000..d406e658ff
--- /dev/null
+++ b/TGServerService/RepoConfig.cs
@@ -0,0 +1,152 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Web.Script.Serialization;
+
+namespace TGServerService
+{
+ ///
+ /// Repository specific information for a
+ ///
+ sealed class RepoConfig : IEquatable
+ {
+ ///
+ /// If this json is setup to support
+ ///
+ public readonly bool ChangelogSupport;
+ ///
+ /// Path to the repository's changelog generator script
+ ///
+ public readonly string PathToChangelogPy;
+ ///
+ /// Arguments for the changelog gennerator script
+ ///
+ public readonly string ChangelogPyArguments;
+ ///
+ /// List of python pip dependencies for the changelog generator script
+ ///
+ public readonly IList PipDependancies = new List();
+ ///
+ /// Paths to commit and push to the remote repository
+ ///
+ public readonly IList PathsToStage = new List();
+ ///
+ /// Directory's whose contents should not be touched when the updates
+ ///
+ public readonly IList StaticDirectoryPaths = new List();
+ ///
+ /// DLL's used by DreamDaemon call()() operations. Must be handled as symlinks to avoid lockups during update operations
+ ///
+ public readonly IList DLLPaths = new List();
+
+ ///
+ /// Construct a RepoConfig
+ ///
+ /// Path to the config JSON to use
+ public RepoConfig(string path)
+ {
+ if (!File.Exists(path))
+ return;
+ var rawdata = File.ReadAllText(path);
+ var Deserializer = new JavaScriptSerializer();
+ var json = Deserializer.Deserialize>(rawdata);
+ try
+ {
+ var details = (IDictionary)json["changelog"];
+ PathToChangelogPy = (string)details["script"];
+ ChangelogPyArguments = (string)details["arguments"];
+ ChangelogSupport = true;
+ try
+ {
+ PipDependancies = LoadArray(details["pip_dependancies"]);
+ }
+ catch { }
+ }
+ catch
+ {
+ ChangelogSupport = false;
+ }
+ try
+ {
+ PathsToStage = LoadArray(json["synchronize_paths"]);
+ }
+ catch { }
+ try
+ {
+ StaticDirectoryPaths = LoadArray(json["static_directories"]);
+ }
+ catch { }
+ try
+ {
+ DLLPaths = LoadArray(json["dlls"]);
+ }
+ catch { }
+ }
+
+ ///
+ /// Convert an array of s to a of s
+ ///
+ /// The array to convert
+ ///
+ private static IList LoadArray(object o)
+ {
+ var array = (object[])o;
+ var res = new List();
+ foreach (var I in array)
+ res.Add((string)I);
+ return res;
+ }
+
+ ///
+ public override bool Equals(object obj)
+ {
+ return Equals(obj as RepoConfig);
+ }
+
+ ///
+ /// Check if two s have the same contents
+ ///
+ /// The first
+ /// The second
+ /// if the s match, otherwise
+ private static bool ListEquals(IList A, IList B)
+ {
+ return A.All(B.Contains) && A.Count == B.Count;
+ }
+
+ public bool Equals(RepoConfig other)
+ {
+ return ChangelogSupport == other.ChangelogSupport
+ && PathToChangelogPy == other.PathToChangelogPy
+ && ChangelogPyArguments == other.ChangelogPyArguments
+ && ListEquals(PipDependancies, other.PipDependancies)
+ && ListEquals(PathsToStage, other.PathsToStage)
+ && ListEquals(StaticDirectoryPaths, other.StaticDirectoryPaths)
+ && ListEquals(DLLPaths, other.DLLPaths);
+ }
+
+ public override int GetHashCode()
+ {
+ var hashCode = 1890628544;
+ hashCode = hashCode * -1521134295 + ChangelogSupport.GetHashCode();
+ hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(PathToChangelogPy);
+ hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ChangelogPyArguments);
+ hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(PipDependancies);
+ hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(PathsToStage);
+ hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(StaticDirectoryPaths);
+ hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(DLLPaths);
+ return hashCode;
+ }
+
+ public static bool operator ==(RepoConfig config1, RepoConfig config2)
+ {
+ return EqualityComparer.Default.Equals(config1, config2);
+ }
+
+ public static bool operator !=(RepoConfig config1, RepoConfig config2)
+ {
+ return !(config1 == config2);
+ }
+ }
+}
diff --git a/TGServerService/ServerInstance/Byond.cs b/TGServerService/ServerInstance/Byond.cs
index 68cfe821b9..9a3715ff99 100644
--- a/TGServerService/ServerInstance/Byond.cs
+++ b/TGServerService/ServerInstance/Byond.cs
@@ -43,7 +43,7 @@ namespace TGServerService
///
/// The instance directory to modify the BYOND cfg before installation
///
- const string ByondConfigDir = "";
+ const string ByondConfigDir = StagingDirectory + "/BYOND/cfg";
///
/// BYOND's DreamDaemon config file in the cfg modification directory
///
diff --git a/TGServerService/ServerInstance/Compiler.cs b/TGServerService/ServerInstance/Compiler.cs
index a5ba1d3b81..ff5e781a4f 100644
--- a/TGServerService/ServerInstance/Compiler.cs
+++ b/TGServerService/ServerInstance/Compiler.cs
@@ -192,7 +192,7 @@ namespace TGServerService
Directory.CreateDirectory(GameDirA);
Directory.CreateDirectory(GameDirB);
- var Config = new RepoConfig(false);
+ var Config = GetCachedRepoConfig();
if (Config != null) {
foreach (var I in Config.StaticDirectoryPaths)
@@ -354,7 +354,7 @@ namespace TGServerService
resurrectee = GetStagingDir();
- var Config = new RepoConfig(false);
+ var Config = GetCachedRepoConfig();
var deleteExcludeList = new List { InterfaceDLLName };
deleteExcludeList.AddRange(Config.StaticDirectoryPaths);
deleteExcludeList.AddRange(Config.DLLPaths);
diff --git a/TGServerService/ServerInstance/Config.cs b/TGServerService/ServerInstance/Config.cs
index b5fb68c179..257952cac2 100644
--- a/TGServerService/ServerInstance/Config.cs
+++ b/TGServerService/ServerInstance/Config.cs
@@ -35,7 +35,7 @@ namespace TGServerService
if (repo)
{
//ensure we aren't trying to read anything outside the static dirs
- var Config = new RepoConfig(false);
+ var Config = GetCachedRepoConfig();
if (Config == null)
{
error = "Unable to load static directory configuration";
diff --git a/TGServerService/ServerInstance/Repository.cs b/TGServerService/ServerInstance/Repository.cs
index 77784770bf..b58f9c31b1 100644
--- a/TGServerService/ServerInstance/Repository.cs
+++ b/TGServerService/ServerInstance/Repository.cs
@@ -14,137 +14,84 @@ namespace TGServerService
{
sealed partial class ServerInstance : ITGRepository, IDisposable
{
+ ///
+ /// The directory for the repository
+ ///
const string RepoPath = "Repository";
+ ///
+ /// The path to the Repository's json
+ ///
const string RepoTGS3SettingsPath = RepoPath + "/TGS3.json";
+ ///
+ /// Path to the 's json
+ ///
const string CachedTGS3SettingsPath = "TGS3.json";
+ ///
+ /// Error message for when a merge operation fails due to the target branch already having the source branch's commits
+ ///
const string RepoErrorUpToDate = "Already up to date!";
+ ///
+ /// Git remote for push operations
+ ///
const string SSHPushRemote = "ssh_push_target";
+ ///
+ /// The directory for the repository SSH keys
+ ///
const string RepoKeyDir = "RepoKey/";
+ ///
+ /// The path to the private ssh-rsa key file
+ ///
const string PrivateKeyPath = RepoKeyDir + "private_key.txt";
+ ///
+ /// The path to the public ssh-rsa key file
+ ///
const string PublicKeyPath = RepoKeyDir + "public_key.txt";
+ ///
+ /// File name for monitoring which github pull requests are currently test merged
+ ///
const string PRJobFile = "prtestjob.json";
+ ///
+ /// The branch that points to the current commit that is live or staged to be live in DreamDaemon
+ ///
const string LiveTrackingBranch = "___TGSLiveCommitTrackingBranch";
+ ///
+ /// Commit message for
+ ///
const string CommitMessage = "Automatic changelog compile, [ci skip]";
+ ///
+ /// Used in conjunction with for multithreading safety
+ ///
object RepoLock = new object();
+ ///
+ /// Used in conjunction with for multithreading safety
+ ///
bool RepoBusy = false;
+ ///
+ /// Whether or not a git clone operation is in progress
+ ///
bool Cloning = false;
+ ///
+ /// The repository object
+ ///
Repository Repo;
+ ///
+ /// Used for reporting operation progress to the
+ ///
int currentProgress = -1;
+ ///
+ /// Used for automatically updating the
+ ///
System.Timers.Timer autoUpdateTimer = new System.Timers.Timer()
{
AutoReset = true
};
///
- /// Repo specific information about the installation
- /// Requires RepoLock and !RepoBusy to be instantiated
+ /// Initializes the repository
///
- class RepoConfig : IEquatable
- {
- public readonly bool ChangelogSupport;
- public readonly string PathToChangelogPy;
- public readonly string ChangelogPyArguments;
- public readonly IList PipDependancies = new List();
- public readonly IList PathsToStage = new List();
- public readonly IList StaticDirectoryPaths = new List();
- public readonly IList DLLPaths = new List();
-
- public RepoConfig(bool FromRepository)
- {
- var path = FromRepository ? RepoTGS3SettingsPath : CachedTGS3SettingsPath;
- if (!File.Exists(path))
- return;
- var rawdata = File.ReadAllText(path);
- var Deserializer = new JavaScriptSerializer();
- var json = Deserializer.Deserialize>(rawdata);
- try
- {
- var details = (IDictionary)json["changelog"];
- PathToChangelogPy = (string)details["script"];
- ChangelogPyArguments = (string)details["arguments"];
- ChangelogSupport = true;
- try
- {
- PipDependancies = LoadArray(details["pip_dependancies"]);
- }
- catch { }
- }
- catch {
- ChangelogSupport = false;
- }
- try
- {
- PathsToStage = LoadArray(json["synchronize_paths"]);
- }
- catch { }
- try
- {
- StaticDirectoryPaths = LoadArray(json["static_directories"]);
- }
- catch { }
- try
- {
- DLLPaths = LoadArray(json["dlls"]);
- }
- catch { }
- }
- private static IList LoadArray(object o)
- {
- var array = (object[])o;
- var res = new List();
- foreach (var I in array)
- res.Add((string)I);
- return res;
- }
-
- public override bool Equals(object obj)
- {
- return Equals(obj as RepoConfig);
- }
-
- private static bool ListEquals(IList A, IList B)
- {
- return A.All(B.Contains) && A.Count == B.Count;
- }
-
- public bool Equals(RepoConfig other)
- {
- return ChangelogSupport == other.ChangelogSupport
- && PathToChangelogPy == other.PathToChangelogPy
- && ChangelogPyArguments == other.ChangelogPyArguments
- && ListEquals(PipDependancies, other.PipDependancies)
- && ListEquals(PathsToStage, other.PathsToStage)
- && ListEquals(StaticDirectoryPaths, other.StaticDirectoryPaths)
- && ListEquals(DLLPaths, other.DLLPaths);
- }
-
- public override int GetHashCode()
- {
- var hashCode = 1890628544;
- hashCode = hashCode * -1521134295 + ChangelogSupport.GetHashCode();
- hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(PathToChangelogPy);
- hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ChangelogPyArguments);
- hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(PipDependancies);
- hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(PathsToStage);
- hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(StaticDirectoryPaths);
- hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(DLLPaths);
- return hashCode;
- }
-
- public static bool operator ==(RepoConfig config1, RepoConfig config2)
- {
- return EqualityComparer.Default.Equals(config1, config2);
- }
-
- public static bool operator !=(RepoConfig config1, RepoConfig config2)
- {
- return !(config1 == config2);
- }
- }
-
void InitRepo()
{
Directory.CreateDirectory(RepoKeyDir);
@@ -157,6 +104,10 @@ namespace TGServerService
SetAutoUpdateInterval(Properties.Settings.Default.AutoUpdateInterval);
}
+ ///
+ /// Checks if the and json files match.
+ ///
+ /// if the jsons match, otherwise
bool RepoConfigsMatch()
{
//this should never be called while the repo is busy
@@ -164,14 +115,23 @@ namespace TGServerService
lock (RepoLock)
{
if (!RepoBusy && LoadRepo() == null)
- I = new RepoConfig(true);
+ I = new RepoConfig(RepoTGS3SettingsPath);
}
if (I == null)
throw new Exception("Unable to load TGS3.json from repo!");
- var J = new RepoConfig(false);
+ var J = GetCachedRepoConfig();
return I == J;
}
+ ///
+ /// Gets the for
+ ///
+ /// The for
+ RepoConfig GetCachedRepoConfig()
+ {
+ return new RepoConfig(CachedTGS3SettingsPath);
+ }
+
///
public bool OperationInProgress()
{
@@ -187,7 +147,10 @@ namespace TGServerService
return currentProgress;
}
- //Sets up the repo object
+ ///
+ /// Initializes
+ ///
+ /// on success, error message on failure
string LoadRepo()
{
if (Repo != null)
@@ -205,7 +168,9 @@ namespace TGServerService
return null;
}
- //Cleans up the repo object
+ ///
+ /// Cleans up
+ ///
void DisposeRepo()
{
if (Repo != null)
@@ -224,35 +189,38 @@ namespace TGServerService
}
}
- //Updates the currentProgress var
- //no locks required because who gives a shit, it's a fucking 32-bit integer
+ ///
+ /// Updates with the progess of the current transfer operation
+ ///
+ /// The of the current transfer operation
+ ///
bool HandleTransferProgress(TransferProgress progress)
{
- currentProgress = (int)(((float)progress.ReceivedObjects / progress.TotalObjects) * 100) / 2;
- currentProgress += (int)(((float)progress.IndexedObjects / progress.TotalObjects) * 100) / 2;
+ currentProgress = ((int)(((float)progress.ReceivedObjects / progress.TotalObjects) * 100) / 2) +( (int)(((float)progress.IndexedObjects / progress.TotalObjects) * 100) / 2);
return true;
}
- //see above
+ ///
+ /// Updates with the progess of the current checkout operation
+ ///
+ /// Ignored
+ /// Dividend for progress calculation
+ /// Divisor for progress calculation
void HandleCheckoutProgress(string path, int completedSteps, int totalSteps)
{
currentProgress = (int)(((float)completedSteps / totalSteps) * 100);
}
- //For the thread parameter
- private class TwoStrings
- {
- public string a, b;
- }
-
- //This is the thread that resets za warldo
- //clones, checksout, sets up static dir
+ ///
+ /// Backups up the and deletes the current if they exist. Clones the given branch of the given remote. Sets up new
+ ///
+ /// Remote and branch name, seperated by a ' '
void Clone(object twostrings)
{
//busy flag set by caller
- var ts = (TwoStrings)twostrings;
- var RepoURL = ts.a;
- var BranchName = ts.b;
+ var ts = ((string)twostrings).Split(' ');
+ var RepoURL = ts[0];
+ var BranchName = ts[1];
try
{
SendMessage(String.Format("REPO: {2} started: Cloning {0} branch of {1} ...", BranchName, RepoURL, Repository.IsValid(RepoPath) ? "Full reset" : "Setup"), MessageType.DeveloperInfo);
@@ -309,12 +277,19 @@ namespace TGServerService
}
}
}
+
+ ///
+ /// Turns off the gc.auto git config setting
+ ///
void DisableGarbageCollectionNoLock()
{
Repo.Config.Set("gc.auto", false);
}
+ ///
+ /// Copies the Static directory to the first available Static_BACKUP path in the then deleted the old directory
+ ///
void BackupAndDeleteStaticDirectory()
{
if (Directory.Exists(StaticDirs))
@@ -335,6 +310,10 @@ namespace TGServerService
Program.DeleteDirectory(StaticDirs);
}
+ ///
+ /// Updates the with the
+ ///
+ /// on success, error message on failure
public string UpdateTGS3Json()
{
try
@@ -351,12 +330,15 @@ namespace TGServerService
return null;
}
+ ///
+ /// Initial setup for the and
+ ///
void InitialConfigureRepository()
{
Directory.CreateDirectory(StaticDirs);
UpdateInterfaceDll(false);
UpdateTGS3Json();
- var Config = new RepoConfig(false); //RepoBusy is set if we're here
+ var Config = GetCachedRepoConfig(); //RepoBusy is set if we're here
foreach(var I in Config.StaticDirectoryPaths)
{
try
@@ -392,8 +374,7 @@ namespace TGServerService
}
}
}
-
- //kicks off the cloning thread
+
///
public string Setup(string RepoURL, string BranchName)
{
@@ -415,12 +396,18 @@ namespace TGServerService
new Thread(new ParameterizedThreadStart(Clone))
{
IsBackground = true //make sure we don't hold up shutdown
- }.Start(new TwoStrings { a = RepoURL, b = BranchName });
+ }.Start(RepoURL + ' ' + BranchName);
return null;
}
}
- //Gets what HEAD is pointing to
+ ///
+ /// Gets the SHA or branch name of the 's HEAD
+ ///
+ /// on success, error message on failure
+ /// If , returns the branch name instead of the SHA
+ /// If , returns the tracked branch SHA and ignores
+ /// The SHA or branch name of the 's HEAD
string GetShaOrBranch(out string error, bool branch, bool tracked)
{
lock (RepoLock)
@@ -446,8 +433,7 @@ namespace TGServerService
}
}
}
-
- //moist shleppy noises
+
///
public string GetHead(bool useTracked, out string error)
{
@@ -481,8 +467,11 @@ namespace TGServerService
}
}
- //calls git reset --hard on HEAD
- //requires RepoLock
+ ///
+ /// Equivalent of running `git reset --hard` on the repository. Requires
+ ///
+ /// If not , reset to this branch instead of HEAD
+ /// on success, error message on failure
string ResetNoLock(Branch targetBranch)
{
try
@@ -547,14 +536,18 @@ namespace TGServerService
}
}
- //Merges a thing into HEAD, not even necessarily a branch
- string MergeBranch(string branchname)
+ ///
+ /// Merges given into the current branch
+ ///
+ /// The sha/branch/tag to merge
+ /// on success, error message on failure
+ string MergeBranch(string committish)
{
var mo = new MergeOptions()
{
OnCheckoutProgress = HandleCheckoutProgress
};
- var Result = Repo.Merge(branchname, MakeSig());
+ var Result = Repo.Merge(committish, MakeSig());
currentProgress = -1;
switch (Result.Status)
{
@@ -574,6 +567,12 @@ namespace TGServerService
return UpdateImpl(reset, true);
}
+ ///
+ /// Fetches the origin and merges it into the current branch
+ ///
+ /// If , the operation will perform a hard reset instead of a merge
+ /// If , a return value of will be changed to
+ /// on success, error message on failure
string UpdateImpl(bool reset, bool successOnUpToDate)
{
lock (RepoLock)
@@ -622,6 +621,9 @@ namespace TGServerService
}
}
+ ///
+ /// Properly updates any git submodules in the repository
+ ///
private void UpdateSubmodules()
{
var suo = new SubmoduleUpdateOptions
@@ -652,6 +654,10 @@ namespace TGServerService
}
}
+ ///
+ /// Creates a date and timestamped tag of the current HEAD
+ ///
+ /// on success, error message on failure
string CreateBackup()
{
try
@@ -686,6 +692,11 @@ namespace TGServerService
}
}
+ ///
+ /// Lists tags in the repository created by the
+ ///
+ /// on success, error message on failure
+ /// A dictionary of tag title -> commit SHA on success, on failure
public IDictionary ListBackups(out string error)
{
try
@@ -728,15 +739,20 @@ namespace TGServerService
return res;
}
}
-
- //Makes the LibGit2Sharp sig we'll use for committing based on the configured stuff
+
+ ///
+ /// Creates a commit based off of the configured name and e-mail
+ ///
+ /// The created
Signature MakeSig()
{
var Config = Properties.Settings.Default;
return new Signature(new Identity(Config.CommitterName, Config.CommitterEmail), DateTimeOffset.Now);
}
- //I wonder...
+ ///
+ /// Deletes the 's
+ ///
void DeletePRList()
{
if (File.Exists(PRJobFile))
@@ -750,7 +766,10 @@ namespace TGServerService
}
}
- //json_decode(file2text())
+ ///
+ /// Deserializes the
+ ///
+ /// A of . The outer one is keyed by PR# the inner one is keyed by internal s
IDictionary> GetCurrentPRList()
{
if (!File.Exists(PRJobFile))
@@ -760,7 +779,10 @@ namespace TGServerService
return Deserializer.Deserialize>>(rawdata);
}
- //text2file(json_encode())
+ ///
+ /// Serializes pull request info into
+ ///
+ ///
void SetCurrentPRList(IDictionary> list)
{
var Serializer = new JavaScriptSerializer();
@@ -770,17 +792,13 @@ namespace TGServerService
///
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: {1}erging PR #{0}...", PRNumber, impliedUpdate ? "Test m" : "M"), MessageType.DeveloperInfo);
+ SendMessage(String.Format("REPO: Merging PR #{0}...", PRNumber), MessageType.DeveloperInfo);
result = ResetNoLock(null);
if (result != null)
return result;
@@ -944,9 +962,10 @@ namespace TGServerService
}
}
+ ///
public string SynchronizePush()
{
- var Config = new RepoConfig(false);
+ var Config = GetCachedRepoConfig();
if (Config == null)
return "Error reading changelog configuration";
if(!Config.ChangelogSupport || !SSHAuth())
@@ -954,6 +973,10 @@ namespace TGServerService
return LocalIsRemote() ? Commit(Config) ?? Push() : "Can't push changelog: HEAD does not match tracked remote branch";
}
+ ///
+ /// Create that Prune and have the appropriate credentials and progress handler
+ ///
+ /// Properly configured
FetchOptions GenerateFetchOptions()
{
return new FetchOptions()
@@ -984,6 +1007,10 @@ namespace TGServerService
}
}
+ ///
+ /// Check if the current HEAD matches the tracked remote branch HEAD
+ ///
+ /// if the current HEAD matches the tracked remote branch HEAD, otherwise
bool LocalIsRemote()
{
lock (RepoLock)
@@ -1003,6 +1030,11 @@ namespace TGServerService
}
}
+ ///
+ /// Create a commit based on a
+ ///
+ /// A with
+ /// on success, error message on failure
string Commit(RepoConfig Config)
{
lock (RepoLock)
@@ -1066,11 +1098,22 @@ namespace TGServerService
}
}
+ ///
+ /// Check if the is configured for SSH pushing
+ ///
+ /// if the see cref="ServerInstance"/> is configured for SSH pushing, otherwise
bool SSHAuth()
{
return File.Exists(PrivateKeyPath) && File.Exists(PublicKeyPath);
}
+ ///
+ /// SSH credentials callback. Properly sets up SSH keys for an authorization operation
+ ///
+ /// Ignored
+ /// The username to use for the operation
+ /// The for the operation
+ /// The proper for the operation
Credentials GenerateGitCredentials(string url, string usernameFromUrl, SupportedCredentialTypes types)
{
var user = usernameFromUrl ?? "git";
@@ -1094,10 +1137,15 @@ namespace TGServerService
return GenerateChangelogImpl(out error);
}
- //impl proc just for single level recursion
+ ///
+ /// Updates the html changelog
+ ///
+ /// on success, error on failure
+ /// If , prevents a recursive call to this function after updating pip dependencies
+ /// The output of the python script
public string GenerateChangelogImpl(out string error, bool recurse = false)
{
- var RConfig = new RepoConfig(false);
+ var RConfig = GetCachedRepoConfig();
if (RConfig == null)
{
error = null;
@@ -1216,11 +1264,17 @@ namespace TGServerService
Properties.Settings.Default.AutoUpdateInterval = newInterval;
}
+ ///
public ulong AutoUpdateInterval()
{
return Properties.Settings.Default.AutoUpdateInterval;
}
-
+
+ ///
+ /// Runs on the configured and tries to and the
+ ///
+ /// A
+ /// The event arguments
private void AutoUpdateTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (UpdateImpl(true, false) == null)
@@ -1238,11 +1292,16 @@ namespace TGServerService
return true;
}
+ ///
public string PythonPath()
{
return Properties.Settings.Default.PythonPath;
}
+ ///
+ /// Updates with the staged 's SHA
+ ///
+ /// The commit SHA that was staged
void UpdateLiveSha(string newSha)
{
if (LoadRepo() != null)
@@ -1253,6 +1312,10 @@ namespace TGServerService
Repo.CreateBranch(LiveTrackingBranch, newSha);
}
+ ///
+ /// Gets the current staged or live commit SHA
+ ///
+ /// The current staged or live commit SHA
public string LiveSha()
{
var B = Repo.Branches[LiveTrackingBranch];
diff --git a/TGServerService/TGServerService.csproj b/TGServerService/TGServerService.csproj
index e35856b188..73d9428b8f 100644
--- a/TGServerService/TGServerService.csproj
+++ b/TGServerService/TGServerService.csproj
@@ -83,6 +83,7 @@
+
diff --git a/TGServiceInterface/Interface.cs b/TGServiceInterface/Interface.cs
index 0398a4b404..21a196edba 100644
--- a/TGServiceInterface/Interface.cs
+++ b/TGServiceInterface/Interface.cs
@@ -24,18 +24,18 @@ namespace TGServiceInterface
///
/// The maximum message size to and from a local server
///
- public static readonly long TransferLimitLocal = Int32.MaxValue; //2GB can't go higher
+ public const long TransferLimitLocal = Int32.MaxValue; //2GB can't go higher
///
/// The maximum message size to and from a remote server
///
- public static readonly long TransferLimitRemote = 10485760; //10 MB
+ public const long TransferLimitRemote = 10485760; //10 MB
///
/// Base name of the communication pipe
/// they are formatted as MasterPipeName/ComponentName
///
- public static string MasterInterfaceName = "TGStationServerService";
+ public const string MasterInterfaceName = "TGStationServerService";
///
/// If this is set, we will try and connect to an HTTPS server running at this address