diff --git a/docs/manual/OptionalTasks/vss.html b/docs/manual/OptionalTasks/vss.html index 3f5967cb3..9c94e75e4 100644 --- a/docs/manual/OptionalTasks/vss.html +++ b/docs/manual/OptionalTasks/vss.html @@ -126,6 +126,17 @@ label only one will be used in the order version, date, label.

label a label to get for + + quiet + suppress output (off by default) + No + + + autoresponse + What to respond with (sets the -I option). By default, -I- is + used; values of Y or N will be appended to this. + No +

Note that only one of version, date or label should be specified

Examples

@@ -201,6 +212,12 @@ project.

The comment to use for this label. Empty or '-' for no comment. No + + autoresponse + What to respond with (sets the -I option). By default, -I- is + used; values of Y or N will be appended to this. + No +

Examples

diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java index dac832d5f..c483c2277 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java @@ -242,5 +242,7 @@ public abstract class MSVSS extends Task { public static final String VALUE_NO = "-N"; /** */ public static final String VALUE_YES = "-Y"; + /** */ + public static final String FLAG_QUIET = "-O-"; } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java index 919ea4420..81e7f5dc6 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java @@ -74,42 +74,53 @@ import java.io.File; * login * username,password * No - * + * * * vsspath * SourceSafe path * Yes - * + * * * localpath * Override the working directory and get to the specified path * No - * + * * * writable * true or false * No - * + * * * recursive * true or false * No - * + * * * version * a version number to get * No - * + * * * date * a date stamp to get at * No - * + * * * label * a label to get for * No + * + * + * quiet + * suppress output (off by default) + * No + * * + * autoresponse + * What to respond with (sets the -I option). By default, -I- is + * used; values of Y or N will be appended to this. + * No + * * *

Note that only one of version, date or label should be specified

* @@ -125,6 +136,7 @@ public class MSVSSGET extends MSVSS { private String m_Date = null; private String m_Label = null; private String m_AutoResponse = null; + private boolean m_Quiet = false; /** * Executes the task. @@ -156,6 +168,8 @@ public class MSVSSGET extends MSVSS { getLocalpathCommand(commandLine); // -I- or -I-Y or -I-N getAutoresponse(commandLine); + // -O- + getQuietCommand(commandLine); // -R getRecursiveCommand(commandLine); // -V @@ -222,6 +236,19 @@ public class MSVSSGET extends MSVSS { } } + /** + * Sets/clears quiet mode + */ + public final void setQuiet (boolean quiet) { + this.m_Quiet=quiet; + } + + public void getQuietCommand (Commandline cmd) { + if (m_Quiet) { + cmd.createArgument().setValue (FLAG_QUIET); + } + } + /** * Set behaviour, used in get command to make files that are 'got' writable */ 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 d795594dd..7852ec87a 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 @@ -93,13 +93,25 @@ import org.apache.tools.ant.types.Commandline; * An existing file or project version to label * No * + * + * autoresponse + * What to respond with (sets the -I option). By default, -I- is + * used; values of Y or N will be appended to this. + * No + * + * + * comment + * The comment to use for this label. Empty or '-' for no comment. + * No + * + * * * * @author Phillip Wells */ public class MSVSSLABEL extends MSVSS { - + private String m_AutoResponse = null; private String m_Label = null; private String m_Version = null; private String m_Comment = "-"; @@ -140,8 +152,8 @@ public class MSVSSLABEL extends MSVSS // -C commandLine.createArgument().setValue("-C"+getComment()); - // -I- - commandLine.createArgument().setValue("-I-"); // ignore all errors + // -I- or -I-Y or -I-N + getAutoresponse(commandLine); // -L // Specify the new label on the command line (instead of being prompted) @@ -243,4 +255,33 @@ public class MSVSSLABEL extends MSVSS public String getComment() { return m_Comment; } + + public void setAutoresponse(String response){ + if ( response.equals("") || response.equals("null") ) { + m_AutoResponse = null; + } else { + m_AutoResponse = response; + } + } + + /** + * Checks the value set for the autoResponse. + * if it equals "Y" then we return -I-Y + * if it equals "N" then we return -I-N + * otherwise we return -I + */ + public void getAutoresponse(Commandline cmd) { + + if ( m_AutoResponse == null) { + cmd.createArgument().setValue(FLAG_AUTORESPONSE_DEF); + } else if ( m_AutoResponse.equalsIgnoreCase("Y")) { + cmd.createArgument().setValue(FLAG_AUTORESPONSE_YES); + + } else if ( m_AutoResponse.equalsIgnoreCase("N")) { + cmd.createArgument().setValue(FLAG_AUTORESPONSE_NO); + }else { + cmd.createArgument().setValue(FLAG_AUTORESPONSE_DEF); + } // end of else + + } }