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

P4Integrate

public class P4Integrate extends P4Base
Integrate file(s). P4Change should be used to obtain a new changelist for P4Integrate, although P4Integrate can open files to the default change, P4Submit cannot yet submit to it. Example Usage:
<p4integrate change="${p4.change}" fromfile="//depot/project/dev/foo.txt" tofile="//depot/project/main/foo.txt" />
ant.task
category="scm"

Fields Summary
private String
change
private String
fromfile
private String
tofile
private String
branch
private boolean
restoredeletedrevisions
private boolean
forceintegrate
private boolean
leavetargetrevision
private boolean
enablebaselessmerges
private boolean
simulationmode
private boolean
reversebranchmappings
private boolean
propagatesourcefiletype
private boolean
nocopynewtargetfiles
Constructors Summary
Methods Summary
public voidexecute()
execute the p4 integrate

throws
BuildException if there are missing parameters

        if (change != null) {
            P4CmdOpts = "-c " + change;
        }
        if (this.forceintegrate) {
            P4CmdOpts = P4CmdOpts + " -f";
        }
        if (this.restoredeletedrevisions) {
                P4CmdOpts = P4CmdOpts + " -d";
            }
        if (this.leavetargetrevision) {
            P4CmdOpts = P4CmdOpts + " -h";
        }
        if (this.enablebaselessmerges) {
            P4CmdOpts = P4CmdOpts + " -i";
        }
        if (this.simulationmode) {
            P4CmdOpts = P4CmdOpts + " -n";
        }
        if (this.reversebranchmappings) {
            P4CmdOpts = P4CmdOpts + " -r";
        }
        if (this.propagatesourcefiletype) {
            P4CmdOpts = P4CmdOpts + " -t";
        }
        if (this.nocopynewtargetfiles) {
            P4CmdOpts = P4CmdOpts + "-v";
        }
        String command;
        if (branch == null && fromfile != null && tofile != null) {
           command = P4CmdOpts + " " + fromfile + " " + tofile;
        } else if (branch != null && fromfile == null && tofile != null) {
            command = P4CmdOpts + " -b " + branch + " " + tofile;
        } else if (branch != null && fromfile != null) {
            command = P4CmdOpts + " -b " + branch + " -s " + fromfile + " " + tofile;
        } else {
            throw new BuildException("you need to specify fromfile and tofile, "
            + "or branch and tofile, or branch and fromfile, or branch and fromfile and tofile ");
        }
        execP4Command("-s integrate " + command, new SimpleP4OutputHandler(this));
    
public java.lang.StringgetBranch()
get the branch

return
the name of the branch

        return branch;
    
public java.lang.StringgetChange()
get the changelist number

return
the changelist number set for this task


                     
       
        return change;
    
public java.lang.StringgetFromfile()
get the from file specification

return
the from file specification

        return fromfile;
    
public java.lang.StringgetTofile()
get the to file specification

return
the to file specification

        return tofile;
    
public booleanisEnableBaselessMerges()
gets the enablebaselessmerges flag

return
boolean indicating if baseless merges are desired

        return enablebaselessmerges;
    
public booleanisForceIntegrate()
gets the forceintegrate flag

return
restore deleted revisions

        return forceintegrate;
    
public booleanisLeaveTargetRevision()
gets the leavetargetrevision flag

return
flag indicating if the target revision should be preserved

        return leavetargetrevision;
    
public booleanisNocopynewtargetfiles()
indicates intention to suppress the copying on the local hard disk of new target files.

return
indicates intention to suppress the copying on the local hard disk of new target files.

        return nocopynewtargetfiles;
    
public booleanisPropagatesourcefiletype()
returns flag indicating if propagation of source file type is sought

return
flag set to true if you want to propagate source file type for existing target files

        return propagatesourcefiletype;
    
public booleanisRestoreDeletedRevisions()
gets the restoredeletedrevisions flag

return
restore deleted revisions

        return restoredeletedrevisions;
    
public booleanisReversebranchmappings()
returns the flag indicating if reverse branch mappings are sought

return
reversebranchmappings flag

        return reversebranchmappings;
    
public booleanisSimulationMode()
gets the simulationmode flag

return
simulation mode flag

        return simulationmode;
    
public voidsetBranch(java.lang.String br)
sets the branch

param
br the name of the branch to use

        this.branch = br;
    
public voidsetChange(java.lang.String change)
set the changelist number for the operation

param
change An existing changelist number to assign files to; optional but strongly recommended.

        this.change = change;
    
public voidsetEnableBaselessMerges(boolean setrest)
sets the enablebaselessmerges flag

param
setrest value chosen for enablebaselessmerges

        this.enablebaselessmerges = setrest;
    
public voidsetForceIntegrate(boolean setrest)
sets the forceintegrate flag

param
setrest value chosen for forceintegrate

        this.forceintegrate = setrest;
    
public voidsetFromfile(java.lang.String fromf)
sets the from file specification

param
fromf the from file specification

        this.fromfile = fromf;
    
public voidsetLeaveTargetRevision(boolean setrest)
sets the leavetargetrevision flag

param
setrest value chosen for leavetargetrevision

        this.leavetargetrevision = setrest;
    
public voidsetNocopynewtargetfiles(boolean nocopynewtargetfiles)
sets nocopynewtargetfiles flag

param
nocopynewtargetfiles set it to true to gain speed in integration by not copying on the local Perforce client new target files

        this.nocopynewtargetfiles = nocopynewtargetfiles;
    
public voidsetPropagatesourcefiletype(boolean propagatesourcefiletype)
sets flag indicating if one wants to propagate the source file type

param
propagatesourcefiletype set it to true if you want to change the type of existing target files according to type of source file.

        this.propagatesourcefiletype = propagatesourcefiletype;
    
public voidsetRestoreDeletedRevisions(boolean setrest)
sets the restoredeletedrevisions flag

param
setrest value chosen for restoredeletedrevisions

        this.restoredeletedrevisions = setrest;
    
public voidsetReversebranchmappings(boolean reversebranchmappings)
sets the reversebranchmappings flag

param
reversebranchmappings flag indicating if reverse branch mappings are sought

        this.reversebranchmappings = reversebranchmappings;
    
public voidsetSimulationMode(boolean setrest)
sets the simulationmode flag

param
setrest value chosen for simulationmode

        this.simulationmode = setrest;
    
public voidsetTofile(java.lang.String tof)
sets the to file specification

param
tof the to file specification

        this.tofile = tof;