FileDocCategorySizeDatePackage
MSVSSHISTORY.javaAPI DocApache Ant 1.706325Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.taskdefs.optional.vss

MSVSSHISTORY

public class MSVSSHISTORY extends MSVSS
Performs History commands to Microsoft Visual SourceSafe.
ant.task
name="vsshistory" category="scm"

Fields Summary
Constructors Summary
Methods Summary
org.apache.tools.ant.types.CommandlinebuildCmdLine()
Builds a command line to execute ss.

return
The constructed commandline.

        Commandline commandLine = new Commandline();

        // first off, make sure that we've got a command and a vssdir and a label ...
        if (getVsspath() == null) {
            String msg = "vsspath attribute must be set!";
            throw new BuildException(msg, getLocation());
        }

        // build the command line from what we got the format is
        // ss History elements [-H] [-L] [-N] [-O] [-V] [-Y] [-#] [-?]
        // as specified in the SS.EXE help
        commandLine.setExecutable(getSSCommand());
        commandLine.createArgument().setValue(COMMAND_HISTORY);

        // VSS items
        commandLine.createArgument().setValue(getVsspath());
        // -I-
        commandLine.createArgument().setValue(FLAG_AUTORESPONSE_DEF);  // ignore all errors
        // -Vd
        commandLine.createArgument().setValue(getVersionDate());
        // -VL
        commandLine.createArgument().setValue(getVersionLabel());
        // -R
        commandLine.createArgument().setValue(getRecursive());
        // -B / -D / -F-
        commandLine.createArgument().setValue(getStyle());
        // -Y
        commandLine.createArgument().setValue(getLogin());
        // -O
        commandLine.createArgument().setValue(getOutput());

        return commandLine;
    
public voidsetDateFormat(java.lang.String dateFormat)
Format of dates in fromDatetoDate. Used when calculating dates with the numdays attribute. This string uses the formatting rules of SimpleDateFormat. Defaults to DateFormat.SHORT.

param
dateFormat The date format.

        super.setInternalDateFormat(new SimpleDateFormat(dateFormat));
    
public voidsetFromDate(java.lang.String fromDate)
Date representing the 'start' of the range.

param
fromDate The start date.

        super.setInternalFromDate(fromDate);
    
public voidsetFromLabel(java.lang.String fromLabel)
Label representing the 'start' of the range.

param
fromLabel The start label.

        super.setInternalFromLabel(fromLabel);
    
public voidsetNumdays(int numd)
Number of days for comparison. Defaults to 2 days.

param
numd The number of days.

        super.setInternalNumDays(numd);
    
public voidsetOutput(java.io.File outfile)
Output file name for the history.

param
outfile The output file name.

        if (outfile != null) {
            super.setInternalOutputFilename(outfile.getAbsolutePath());
        }
    
public voidsetRecursive(boolean recursive)
Retrieve history recursively. Defaults to false.

param
recursive The boolean value for recursive.

        super.setInternalRecursive(recursive);
    
public voidsetStyle(org.apache.tools.ant.taskdefs.optional.vss.MSVSSHISTORY$BriefCodediffNofile attr)
Output style. Valid options are:
  • brief: -B Display a brief history.
  • codediff: -D Display line-by-line file changes.
  • nofile: -F- Do not display individual file updates in the project history.
  • default: No option specified. Display in Source Safe's default format.

param
attr The history style:

        String option = attr.getValue();
        if (option.equals(STYLE_BRIEF)) {
            super.setInternalStyle(FLAG_BRIEF);
        } else if (option.equals(STYLE_CODEDIFF)) {
            super.setInternalStyle(FLAG_CODEDIFF);
        } else if (option.equals(STYLE_DEFAULT)) {
            super.setInternalStyle("");
        } else if (option.equals(STYLE_NOFILE)) {
            super.setInternalStyle(FLAG_NO_FILE);
        } else {
            throw new BuildException("Style " + attr + " unknown.", getLocation());
        }
    
public voidsetToDate(java.lang.String toDate)
Date representing the 'end' of the range.

param
toDate The end date.

        super.setInternalToDate(toDate);
    
public voidsetToLabel(java.lang.String toLabel)
Label representing the 'end' of the range.

param
toLabel The end label.

        super.setInternalToLabel(toLabel);
    
public voidsetUser(java.lang.String user)
Name of the user whose change history is generated.

param
user The username.

        super.setInternalUser(user);