FileDocCategorySizeDatePackage
P4Resolve.javaAPI DocApache Ant 1.705960Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant.taskdefs.optional.perforce

P4Resolve

public class P4Resolve extends P4Base
ant.task
category="scm"

Fields Summary
private String
resolvemode
private boolean
redoall
private boolean
simulationmode
private boolean
forcetextmode
private boolean
markersforall
private static final String
AUTOMATIC
private static final String
FORCE
private static final String
SAFE
private static final String
THEIRS
private static final String
YOURS
private static final String[]
RESOLVE_MODES
Constructors Summary
Methods Summary
public voidexecute()
execute the p4 resolve

throws
BuildException if there is a wrong resolve mode specified or no view specified

        if (this.resolvemode.equals(AUTOMATIC)) {
            P4CmdOpts = P4CmdOpts + " -am";
        } else if (this.resolvemode.equals(FORCE)) {
            P4CmdOpts = P4CmdOpts + " -af";
        } else if (this.resolvemode.equals(SAFE)) {
            P4CmdOpts = P4CmdOpts + " -as";
        } else if (this.resolvemode.equals(THEIRS)) {
            P4CmdOpts = P4CmdOpts + " -at";
        } else if (this.resolvemode.equals(YOURS)) {
            P4CmdOpts = P4CmdOpts + " -ay";
        } else {
            throw new BuildException("unsupported or absent resolve mode");
        }
        if (P4View == null) {
            throw new BuildException("please specify a view");
        }
        if (this.isRedoall()) {
            P4CmdOpts = P4CmdOpts + " -f";
        }
        if (this.isSimulationmode()) {
            P4CmdOpts = P4CmdOpts + " -n";
        }
        if (this.isForcetextmode()) {
            P4CmdOpts = P4CmdOpts + " -t";
        }
        if (this.isMarkersforall()) {
            P4CmdOpts = P4CmdOpts + " -v";
        }
        execP4Command("-s resolve " + P4CmdOpts + " " + P4View, new SimpleP4OutputHandler(this));
    
public java.lang.StringgetResolvemode()
returns the resolve mode

return
returns the resolve mode

                 
       
        return resolvemode;
    
public booleanisForcetextmode()
If set to true, attempts a textual merge, even for binary files

return
flag value

        return forcetextmode;
    
public booleanisMarkersforall()
If set to true, puts in markers for all changes, conflicting or not

return
flag markersforall value

        return markersforall;
    
public booleanisRedoall()
allows previously resolved files to be resolved again

return
flag indicating whether one wants to allow previously resolved files to be resolved again

        return redoall;
    
public booleanisSimulationmode()
read the simulation mode flag

return
flag indicating whether one wants just to simulate the p4 resolve operation whithout actually doing it

        return simulationmode;
    
public voidsetForcetextmode(boolean forcetextmode)
If set to true, attempts a textual merge, even for binary files

param
forcetextmode set the flag value

        this.forcetextmode = forcetextmode;
    
public voidsetMarkersforall(boolean markersforall)
If set to true, puts in markers for all changes, conflicting or not

param
markersforall flag true or false

        this.markersforall = markersforall;
    
public voidsetRedoall(boolean redoall)
set the redoall flag

param
redoall flag indicating whether one want to allow previously resolved files to be resolved again

        this.redoall = redoall;
    
public voidsetResolvemode(java.lang.String resolvemode)
values for resolvemode
  • automatic -am
  • force -af
  • safe -as
  • theirs -at
  • yours -ay

param
resolvemode one of automatic, force, safe, theirs, yours

        boolean found = false;
        for (int counter = 0; counter < RESOLVE_MODES.length; counter++) {
            if (resolvemode.equals(RESOLVE_MODES[counter])) {
                found = true;
                break;
            }
        }
        if (!found) {
            throw new BuildException("Unacceptable value for resolve mode");
        }
        this.resolvemode = resolvemode;
    
public voidsetSimulationmode(boolean simulationmode)
sets a flag

param
simulationmode set to true, lists the integrations which would be performed, without actually doing them.

        this.simulationmode = simulationmode;