FileDocCategorySizeDatePackage
P4Labelsync.javaAPI DocApache Ant 1.704882Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs.optional.perforce

P4Labelsync

public class P4Labelsync extends P4Base
This method syncs an existing Perforce label against the Perforce client or against a set of files/revisions. Example Usage:
<p4labelsync name="MyLabel-${TSTAMP}-${DSTAMP}"
view="//depot/...#head;//depot2/file1#25" />
ant.task
category="scm"

Fields Summary
protected String
name
private boolean
add
private boolean
delete
private boolean
simulationmode
Constructors Summary
Methods Summary
public voidexecute()
do the work

throws
BuildException if the label name is not supplied

        log("P4Labelsync exec:", Project.MSG_INFO);

        if (P4View != null && P4View.length() >= 1) {
            P4View = StringUtils.replace(P4View, ":", "\n\t");
            P4View = StringUtils.replace(P4View, ";", "\n\t");
        }
        if (P4View == null) {
            P4View = "";
        }

        if (name == null || name.length() < 1) {
            throw new BuildException("name attribute is compulsory for labelsync");
        }

        if (this.isSimulationmode()) {
            P4CmdOpts = P4CmdOpts + " -n";
        }
        if (this.isDelete()) {
            P4CmdOpts = P4CmdOpts + " -d";
        }
        if (this.isAdd()) {
            P4CmdOpts = P4CmdOpts + " -a";
        }

        execP4Command("-s labelsync -l " + name + " " + P4CmdOpts + " " + P4View,
            new SimpleP4OutputHandler(this));


    
public booleanisAdd()
-a flag of p4 labelsync - preserve files which exist in the label, but not in the current view

return
add attribute if set to true the task will not remove any files from the label only add files which were not there previously or update these where the revision has changed the add attribute is the -a flag of p4 labelsync

        return add;
    
public booleanisDelete()
-d flag of p4 labelsync; indicates an intention of deleting from the label the files specified in the view

return
delete attribute

        return delete;
    
public booleanisSimulationmode()
-n flag of p4 labelsync - display changes without actually doing them

return
-n flag of p4 labelsync

        return simulationmode;
    
public voidsetAdd(boolean add)
-a flag of p4 labelsync - preserve files which exist in the label, but not in the current view

param
add if set to true the task will not remove any files from the label only add files which were not there previously or update these where the revision has changed the add attribute is the -a flag of p4 labelsync

        this.add = add;
    
public voidsetDelete(boolean delete)
-d flag of p4 labelsync; indicates an intention of deleting from the label the files specified in the view

param
delete indicates intention of deleting from the label the files specified in the view

        this.delete = delete;
    
public voidsetName(java.lang.String name)
The name of the label; optional, default "AntLabel"

param
name of the label

        this.name = name;
    
public voidsetSimulationmode(boolean simulationmode)
-n flag of p4 labelsync - display changes without actually doing them

param
simulationmode display changes without actually doing them

        this.simulationmode = simulationmode;