|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.perforce.p4java.ant.tasks.PerforceTask
com.perforce.p4java.ant.tasks.ServerTask
com.perforce.p4java.ant.tasks.ClientTask
com.perforce.p4java.ant.tasks.Diff2Task
public class Diff2Task
Run diff (on the server) of two files in the depot. Both files may optionally include a revision specification; the default is to compare the head revision. Wildcards may be used, but they must match between file1 and file2. Note if using clients or labels as file arguments they must be preceded with a file path e.g. //...@mylabel //...@yourlabel.
PerforceTask
,
ServerTask
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.perforce.p4java.ant.tasks.ServerTask |
---|
ServerTask.GlobalOption |
Nested classes/interfaces inherited from class com.perforce.p4java.ant.tasks.PerforceTask |
---|
PerforceTask.Field, PerforceTask.File |
Field Summary | |
---|---|
protected java.lang.String |
branch
If not null, it causes diff2 to use the branch view to specify the pairs of files to compare. |
protected int |
diffContext
If positive, specifies the number of context diff lines; if zero, lets server pick context number; if negative, no options are generated. |
protected java.lang.String |
file1
The first depot file and revision specifier for diff2. |
protected IFileSpec |
file1FileSpec
Left depot file and revision specifier used as input for this Perforce command. |
protected java.lang.String |
file2
The second depot file and revision specifier for diff2. |
protected IFileSpec |
file2FileSpec
Right depot file and revision specifier used as input for this Perforce command. |
protected boolean |
ignoreLineEndings
If true, ignore line endings; corresponds to -dl. |
protected boolean |
ignoreWhitespace
If true, ignore whitespace; corresponds to -dw. |
protected boolean |
ignoreWhitespaceChanges
If true, ignore whitespace changes; corresponds to -db. |
protected boolean |
includeNonTextDiffs
If true, diff even files with non-text (binary) types. |
protected boolean |
quiet
If true, suppresses the display of the header lines of files whose content and types are identical and suppresses the actual diff for all files. |
protected boolean |
rcsDiffs
If true, use RCS diff; corresponds to -dn. |
protected java.util.List<IFileDiff> |
retFileDiffs
Collection of file diffs returned from the Perforce command. |
protected boolean |
summaryDiff
If true, perform summary diff; corresponds to -ds. |
protected int |
unifiedDiff
If true, do a unified diff; corresponds to -du[n] with -du generated for unifiedDiff == 0, -dun for unifiedDiff > 0, where "n" is of course the value of unifiedDiff. |
Fields inherited from class com.perforce.p4java.ant.tasks.ClientTask |
---|
p4Client |
Fields inherited from class com.perforce.p4java.ant.tasks.ServerTask |
---|
allHosts, commandOptions, globaloptions, hostName, P4_SERVER_PROTOCOL_PROPERTIES_FILE, P4_SERVER_USAGE_PROPERTIES_FILE, p4Server, programName, programVersion, protocolPropertiesFile, protocolProps, textLanguage, unsetClientName, unsetUserName, usagePropertiesFile, usageProps, workingDirectory |
Fields inherited from class com.perforce.p4java.ant.tasks.PerforceTask |
---|
charset, client, failOnError, fields, FILE_TOKEN_REGEX_PATTERN, fileList, files, fileSpecs, LINE_PADDING, LINE_SEPARATOR, p4Messages, passwd, port, protocol, retFileSpecs, retStatusMessage, user |
Fields inherited from class org.apache.tools.ant.Task |
---|
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
Diff2Task()
Default constructor. |
Method Summary | |
---|---|
protected void |
execP4Command()
Execute the Perforce diff2 command with file spec 1, file spec 2, branch and options. |
IFileSpec |
getFile1FileSpec()
Gets the file1 file spec. |
IFileSpec |
getFile2FileSpec()
Gets the file2 file spec. |
java.util.List<IFileDiff> |
getRetFileDiffs()
Gets the ret file diffs. |
void |
setBranch(java.lang.String branch)
Sets the branch. |
void |
setDiffContext(int diffContext)
Sets the diff context. |
void |
setFile1(java.lang.String file1)
Sets the file1. |
void |
setFile2(java.lang.String file2)
Sets the file2. |
void |
setGnuDiffs(boolean gnuDiffs)
Sets the gnu diffs. |
void |
setIgnoreLineEndings(boolean ignoreLineEndings)
Sets the ignore line endings. |
void |
setIgnoreWhitespace(boolean ignoreWhitespace)
Sets the ignore whitespace. |
void |
setIgnoreWhitespaceChanges(boolean ignoreWhitespaceChanges)
Sets the ignore whitespace changes. |
void |
setIncludeNonTextDiffs(boolean includeNonTextDiffs)
Sets the include non text diffs. |
void |
setQuiet(boolean quiet)
Sets the quiet. |
void |
setRcsDiffs(boolean rcsDiffs)
Sets the rcs diffs. |
void |
setSummaryDiff(boolean summaryDiff)
Sets the summary diff. |
void |
setUnifiedDiff(int unifiedDiff)
Sets the unified diff. |
Methods inherited from class com.perforce.p4java.ant.tasks.ClientTask |
---|
cleanupP4, getP4Client, initP4, setP4Client |
Methods inherited from class com.perforce.p4java.ant.tasks.ServerTask |
---|
cleanupP4Server, createGlobalOption, getGlobalOptions, getP4Server, initP4Server, initP4ServerOptions, setAllHosts, setHostName, setP4Server, setProgramName, setProgramVersion, setProtocolPropertiesFile, setProtocolProps, setTextLanguage, setUnsetClientName, setUnsetUserName, setUsagePropertiesFile, setUsageProps, setWorkingDirectory |
Methods inherited from class com.perforce.p4java.ant.tasks.PerforceTask |
---|
addFileset, createField, createFile, execute, getFields, getFiles, getFileSpecs, getRetFileSpecs, getRetStatusMessage, init, isEmpty, logChangelistSummaries, logChangelistSummary, logExtendedFileSpec, logExtendedFileSpecs, logFileDiff, logFileDiffs, logFileLineMatch, logFileLineMatches, logFileSpec, logFileSpecs, logFix, logFixes, logJob, logJobs, parseChangelist, setCharset, setClient, setFailOnError, setFiles, setPasswd, setPort, setProtocol, setUser |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String file1
protected java.lang.String file2
protected java.lang.String branch
protected boolean quiet
protected boolean includeNonTextDiffs
protected boolean rcsDiffs
protected int diffContext
protected boolean summaryDiff
protected int unifiedDiff
protected boolean ignoreWhitespaceChanges
protected boolean ignoreWhitespace
protected boolean ignoreLineEndings
protected IFileSpec file1FileSpec
protected IFileSpec file2FileSpec
protected java.util.List<IFileDiff> retFileDiffs
Constructor Detail |
---|
public Diff2Task()
Method Detail |
---|
public void setFile1(java.lang.String file1)
file1
- the new file1public void setFile2(java.lang.String file2)
file2
- the new file2public void setBranch(java.lang.String branch)
branch
- the new branchpublic void setQuiet(boolean quiet)
quiet
- the new quietpublic void setIncludeNonTextDiffs(boolean includeNonTextDiffs)
includeNonTextDiffs
- the new include non text diffspublic void setGnuDiffs(boolean gnuDiffs)
gnuDiffs
- the new gnu diffspublic void setRcsDiffs(boolean rcsDiffs)
rcsDiffs
- the new rcs diffspublic void setDiffContext(int diffContext)
diffContext
- the new diff contextpublic void setSummaryDiff(boolean summaryDiff)
summaryDiff
- the new summary diffpublic void setUnifiedDiff(int unifiedDiff)
unifiedDiff
- the new unified diffpublic void setIgnoreWhitespaceChanges(boolean ignoreWhitespaceChanges)
ignoreWhitespaceChanges
- the new ignore whitespace changespublic void setIgnoreWhitespace(boolean ignoreWhitespace)
ignoreWhitespace
- the new ignore whitespacepublic void setIgnoreLineEndings(boolean ignoreLineEndings)
ignoreLineEndings
- the new ignore line endingspublic IFileSpec getFile1FileSpec()
public IFileSpec getFile2FileSpec()
public java.util.List<IFileDiff> getRetFileDiffs()
protected void execP4Command() throws org.apache.tools.ant.BuildException
Run diff on the Perforce server of two files in the depot.
This method corresponds closely to the standard diff2 command, and that command's documentation should be consulted for the overall and detailed semantics
execP4Command
in class PerforceTask
org.apache.tools.ant.BuildException
- the build exceptionPerforceTask.execP4Command()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |