Here is a quick and dirty hack that should do it somehow (see attached
patch). It builds, didn't try if it works though. You can see what needs
to be done from the patch but i think it could be a it cleaner... And
tests are missing of course...

I hope it helps.

Kind regards,

Daniel


On Tue, 2010-09-28 at 11:57 -0400, Andy Levy wrote:
> I'm taking a look at it right now. Not sure how far I can take it but
> I'll do what I can. Can I get away with more or less lifting what's
> done for Git & dropping it into the corresponding areas for
> Subversion?
Index: Svn.cs
===================================================================
--- Svn.cs	(revision 7569)
+++ Svn.cs	(working copy)
@@ -182,7 +182,9 @@
             this.Executable = DefaultExecutable;
             this.TagOnSuccess = false;
             this.TagWorkingCopy = false;
-            this.DeleteObstructions = false;
+			this.TagCommitMessage = "CCNet Build {0}";
+			this.TagNameFormat = "{0}";
+			this.DeleteObstructions = false;
             this.AutoGetSource = true;
             this.CheckExternals = false;
             this.CheckExternalsRecursive = true;
@@ -203,7 +205,7 @@
         /// <default>None</default>
         [ReflectorProperty("webUrlBuilder", InstanceTypeKey = "type", Required = false)]
         public IModificationUrlBuilder UrlBuilder { get; set; }
-
+		
         /// <summary>
         /// The location of the svn executable.
         /// </summary>
@@ -235,16 +237,33 @@
         /// <default>false</default>
         [ReflectorProperty("tagOnSuccess", Required = false)]
         public bool TagOnSuccess { get; set; }
-
-        /// <summary>
+		
+		/// <summary>
         /// Indicates that the Working Copy should always be used when Cruise Control creates a tag.
         /// </summary>
         /// <version>1.6</version>
         /// <default>false</default>
         [ReflectorProperty("tagWorkingCopy", Required = false)]
         public bool TagWorkingCopy { get; set; }
-
-        /// <summary>
+		
+		/// <summary>
+        /// Format string for the commit message of each tag. {0} is the placeholder for the current build label. 
+        /// </summary>
+        /// <version>1.5</version>
+        /// <default>CCNet Build {0}</default>
+        [ReflectorProperty("tagCommitMessage", Required = false)]
+        public string TagCommitMessage { get; set; }
+		
+		/// <summary>
+        /// Format string for the name of each tag. Make sure you're only using allowed characters. {0} is the placeholder for the current
+        /// build label. 
+        /// </summary>
+        /// <version>1.5</version>
+        /// <default>{0}</default>
+        [ReflectorProperty("tagNameFormat", Required = false)]
+        public string TagNameFormat { get; set; }
+		
+		/// <summary>
         /// Should any detected obstructions be deleted prior to getting modifications?
         /// </summary>
         /// <version>1.5</version>
@@ -771,9 +790,15 @@
             return pos;
         }
 
-        private static string TagMessage(string label)
+        private string TagMessage(string label)
         {
-            return string.Format("-m \"CCNET build {0}\"", label);
+			if((TagCommitMessage != null) && (TagCommitMessage != string.Empty))
+			{
+				string message = string.Format(TagCommitMessage, label);
+				return string.Format("-m \"{0}\"", message);
+			}
+			
+            return string.Format("-m \"CCNet Build {0}\"", label);
         }
 
         private string TagSource(IIntegrationResult result)
@@ -787,7 +812,13 @@
 
         private string TagDestination(string label)
         {
-            return string.Format("{0}/{1}", TagBaseUrl, label);
+			if((TagNameFormat != null) && (TagNameFormat != string.Empty))
+			{
+				string mylabel = string.Format(TagNameFormat, label);
+				return string.Format("{0}/{1}", TagBaseUrl, mylabel);
+			}
+			
+			return string.Format("{0}/{1}", TagBaseUrl, label);
         }
 
         private void AppendCommonSwitches(PrivateArguments buffer)

Reply via email to