From 27fceb3e47e3f847dcbb53a31900620b204939d3 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 27 Apr 2017 13:08:43 -0400 Subject: [PATCH 1/2] Fixed issue with unquoted parameters' --- project/core/sourcecontrol/Surround.cs | 80 +++++++++++++------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/project/core/sourcecontrol/Surround.cs b/project/core/sourcecontrol/Surround.cs index da4e36338..ab0ac502c 100644 --- a/project/core/sourcecontrol/Surround.cs +++ b/project/core/sourcecontrol/Surround.cs @@ -41,15 +41,15 @@ namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol /// /// [ReflectorType("surround")] - public class Surround : ProcessSourceControl - { + public class Surround : ProcessSourceControl + { /// /// /// /// - public const string TO_SSCM_DATE_FORMAT = "yyyyMMddHHmmss"; - private const string DefaultServerConnection = "127.0.0.1:4900"; - private const string DefaultServerLogin = "Administrator:"; + public const string TO_SSCM_DATE_FORMAT = "yyyyMMddHHmmss"; + private const string DefaultServerConnection = "127.0.0.1:4900"; + private const string DefaultServerLogin = "Administrator:"; /// /// Initializes a new instance of the class. @@ -145,65 +145,65 @@ public Surround() /// To. /// /// - public override Modification[] GetModifications(IIntegrationResult from, IIntegrationResult to) - { - string command = string.Format(System.Globalization.CultureInfo.CurrentCulture,"cc {0} -d{1}:{2} {3} -b{4} -p{5} {6} -z{7} -y{8}", - File, - from.StartTime.ToString(TO_SSCM_DATE_FORMAT, CultureInfo.CurrentCulture), - to.StartTime.ToString(TO_SSCM_DATE_FORMAT, CultureInfo.CurrentCulture), - (Recursive == 0) ?string.Empty : "-r", - Branch, - Repository, - (SearchRegExp == 0) ? "-x-" : "-x", - ServerConnect, - ServerLogin); + public override Modification[] GetModifications(IIntegrationResult from, IIntegrationResult to) + { + string command = string.Format(System.Globalization.CultureInfo.CurrentCulture,"cc '{0}' -d{1}:{2} {3} -b'{4}' -p'{5}' {6} -z'{7}' -y'{8}'", + File, + from.StartTime.ToString(TO_SSCM_DATE_FORMAT, CultureInfo.CurrentCulture), + to.StartTime.ToString(TO_SSCM_DATE_FORMAT, CultureInfo.CurrentCulture), + (Recursive == 0) ?string.Empty : "-r", + Branch, + Repository, + (SearchRegExp == 0) ? "-x-" : "-x", + ServerConnect, + ServerLogin); Modification[] modifications = GetModifications(CreateSSCMProcessInfo(command), from.StartTime, to.StartTime); base.FillIssueUrl(modifications); return modifications; } - private ProcessInfo CreateSSCMProcessInfo(string command) - { - return new ProcessInfo(Executable, command); - } + private ProcessInfo CreateSSCMProcessInfo(string command) + { + return new ProcessInfo(Executable, command); + } /// /// Labels the source control. /// /// The result. /// - public override void LabelSourceControl(IIntegrationResult result) - {} + public override void LabelSourceControl(IIntegrationResult result) + {} /// /// Initializes the specified project. /// /// The project. /// - public override void Initialize(IProject project) - { - Execute(CreateSSCMProcessInfo("workdir " + WorkingDirectory + " " + Repository + " -z" + ServerConnect + " -y" + ServerLogin)); - } + public override void Initialize(IProject project) + { + Execute(CreateSSCMProcessInfo("workdir " + WorkingDirectory + " " + Repository + " -z" + ServerConnect + " -y" + ServerLogin)); + } /// /// Gets the source. /// /// The result. /// - public override void GetSource(IIntegrationResult result) - { - Log.Info("Getting source from Surround SCM"); + public override void GetSource(IIntegrationResult result) + { + Log.Info("Getting source from Surround SCM"); result.BuildProgressInformation.SignalStartRunTask("Getting source from Surround SCM"); - string command = string.Format(System.Globalization.CultureInfo.CurrentCulture,"get * -q -tcheckin -wreplace {0} -d{1} -b{2} -p{3} -z{4} -y{5}", - (Recursive == 0) ?string.Empty : "-r", - WorkingDirectory, - Branch, - Repository, - ServerConnect, - ServerLogin); - Execute(CreateSSCMProcessInfo(command)); - } - } + string command = string.Format(System.Globalization.CultureInfo.CurrentCulture,"get * -q -tcheckin -wreplace {0} -d'{1}' -b'{2}' -p'{3}' -z'{4}' -y'{5}'", + (Recursive == 0) ?string.Empty : "-r", + WorkingDirectory, + Branch, + Repository, + ServerConnect, + ServerLogin); + Execute(CreateSSCMProcessInfo(command)); + } + } } \ No newline at end of file From ffb61a8aae04564056df9ef1f641d63b644dfea5 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 27 Apr 2017 13:11:46 -0400 Subject: [PATCH 2/2] Removed changes to tab vs. spaces --- project/core/sourcecontrol/Surround.cs | 80 +++++++++++++------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/project/core/sourcecontrol/Surround.cs b/project/core/sourcecontrol/Surround.cs index ab0ac502c..16842eb0c 100644 --- a/project/core/sourcecontrol/Surround.cs +++ b/project/core/sourcecontrol/Surround.cs @@ -41,15 +41,15 @@ namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol /// /// [ReflectorType("surround")] - public class Surround : ProcessSourceControl - { + public class Surround : ProcessSourceControl + { /// /// /// /// - public const string TO_SSCM_DATE_FORMAT = "yyyyMMddHHmmss"; - private const string DefaultServerConnection = "127.0.0.1:4900"; - private const string DefaultServerLogin = "Administrator:"; + public const string TO_SSCM_DATE_FORMAT = "yyyyMMddHHmmss"; + private const string DefaultServerConnection = "127.0.0.1:4900"; + private const string DefaultServerLogin = "Administrator:"; /// /// Initializes a new instance of the class. @@ -145,65 +145,65 @@ public Surround() /// To. /// /// - public override Modification[] GetModifications(IIntegrationResult from, IIntegrationResult to) - { - string command = string.Format(System.Globalization.CultureInfo.CurrentCulture,"cc '{0}' -d{1}:{2} {3} -b'{4}' -p'{5}' {6} -z'{7}' -y'{8}'", - File, - from.StartTime.ToString(TO_SSCM_DATE_FORMAT, CultureInfo.CurrentCulture), - to.StartTime.ToString(TO_SSCM_DATE_FORMAT, CultureInfo.CurrentCulture), - (Recursive == 0) ?string.Empty : "-r", - Branch, - Repository, - (SearchRegExp == 0) ? "-x-" : "-x", - ServerConnect, - ServerLogin); + public override Modification[] GetModifications(IIntegrationResult from, IIntegrationResult to) + { + string command = string.Format(System.Globalization.CultureInfo.CurrentCulture,"cc '{0}' -d{1}:{2} {3} -b'{4}' -p'{5}' {6} -z'{7}' -y'{8}'", + File, + from.StartTime.ToString(TO_SSCM_DATE_FORMAT, CultureInfo.CurrentCulture), + to.StartTime.ToString(TO_SSCM_DATE_FORMAT, CultureInfo.CurrentCulture), + (Recursive == 0) ?string.Empty : "-r", + Branch, + Repository, + (SearchRegExp == 0) ? "-x-" : "-x", + ServerConnect, + ServerLogin); Modification[] modifications = GetModifications(CreateSSCMProcessInfo(command), from.StartTime, to.StartTime); base.FillIssueUrl(modifications); return modifications; } - private ProcessInfo CreateSSCMProcessInfo(string command) - { - return new ProcessInfo(Executable, command); - } + private ProcessInfo CreateSSCMProcessInfo(string command) + { + return new ProcessInfo(Executable, command); + } /// /// Labels the source control. /// /// The result. /// - public override void LabelSourceControl(IIntegrationResult result) - {} + public override void LabelSourceControl(IIntegrationResult result) + {} /// /// Initializes the specified project. /// /// The project. /// - public override void Initialize(IProject project) - { - Execute(CreateSSCMProcessInfo("workdir " + WorkingDirectory + " " + Repository + " -z" + ServerConnect + " -y" + ServerLogin)); - } + public override void Initialize(IProject project) + { + Execute(CreateSSCMProcessInfo("workdir " + WorkingDirectory + " " + Repository + " -z" + ServerConnect + " -y" + ServerLogin)); + } /// /// Gets the source. /// /// The result. /// - public override void GetSource(IIntegrationResult result) - { - Log.Info("Getting source from Surround SCM"); + public override void GetSource(IIntegrationResult result) + { + Log.Info("Getting source from Surround SCM"); result.BuildProgressInformation.SignalStartRunTask("Getting source from Surround SCM"); - string command = string.Format(System.Globalization.CultureInfo.CurrentCulture,"get * -q -tcheckin -wreplace {0} -d'{1}' -b'{2}' -p'{3}' -z'{4}' -y'{5}'", - (Recursive == 0) ?string.Empty : "-r", - WorkingDirectory, - Branch, - Repository, - ServerConnect, - ServerLogin); - Execute(CreateSSCMProcessInfo(command)); - } - } + string command = string.Format(System.Globalization.CultureInfo.CurrentCulture,"get * -q -tcheckin -wreplace {0} -d'{1}' -b'{2}' -p'{3}' -z'{4}' -y'{5}'", + (Recursive == 0) ?string.Empty : "-r", + WorkingDirectory, + Branch, + Repository, + ServerConnect, + ServerLogin); + Execute(CreateSSCMProcessInfo(command)); + } + } } \ No newline at end of file