From d939c519a139776320be98b624e1002f42123e4c Mon Sep 17 00:00:00 2001 From: Nico Seessle Date: Sun, 29 Apr 2001 16:13:53 +0000 Subject: [PATCH] vsslabel now allows to specify a comment for the label. Submitted by: Jon Skeet git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268983 13f79535-47bb-0310-9956-ffa450edef68 --- .../ant/taskdefs/optional/vss/MSVSSLABEL.java | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java index a7420cbbf..d795594dd 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java @@ -102,6 +102,7 @@ public class MSVSSLABEL extends MSVSS private String m_Label = null; private String m_Version = null; + private String m_Comment = "-"; public static final String FLAG_LABEL = "-L"; @@ -137,8 +138,7 @@ public class MSVSSLABEL extends MSVSS commandLine.createArgument().setValue(getVsspath()); // -C - // Use the same comment for all labels - // Not required + commandLine.createArgument().setValue("-C"+getComment()); // -I- commandLine.createArgument().setValue("-I-"); // ignore all errors @@ -222,4 +222,25 @@ public class MSVSSLABEL extends MSVSS return m_Label; } + /** + * Set the comment to apply in SourceSafe + *

+ * If this is null or empty, it will be replaced with "-" which + * is what SourceSafe uses for an empty comment. + */ + public void setComment(String comment) { + if ( comment.equals("") || comment.equals("null") ) { + m_Comment = "-"; + } else { + m_Comment = comment; + } + } + + /** + * Gets the comment to be applied. + * @return the comment to be applied. + */ + public String getComment() { + return m_Comment; + } }