Class SvnDiffGenerator
java.lang.Object
org.tmatesoft.svn.core.internal.wc2.ng.SvnDiffGenerator
- All Implemented Interfaces:
ISvnDiffGenerator
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SvnTarget
private boolean
private boolean
private SVNDiffOptions
private String
private byte[]
private String
private boolean
private boolean
private boolean
protected static final String
protected static final String
private boolean
private ISVNOptions
private SvnTarget
private SvnTarget
protected static final String
private boolean
private SvnTarget
private SvnTarget
private boolean
protected static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
adjustRelativeToReposRoot
(String targetString) private String
computeLabel
(String targetString, String originalTargetString) void
displayAddedDirectory
(SvnTarget target, String revision1, String revision2, OutputStream outputStream) private void
displayBinary
(String mimeType1, String mimeType2, OutputStream outputStream, boolean leftIsBinary, boolean rightIsBinary) private void
displayCannotDisplayFileMarkedBinary
(OutputStream outputStream) void
displayContentChanged
(SvnTarget target, File leftFile, File rightFile, String revision1, String revision2, String mimeType1, String mimeType2, SvnDiffCallback.OperationKind operation, File copyFromPath, SVNProperties originalProperties, SVNProperties propChanges, OutputStream outputStream) void
displayDeletedDirectory
(SvnTarget target, String revision1, String revision2, OutputStream outputStream) private void
private void
displayFirstGitLabelPath
(OutputStream outputStream, String path1, String revision1, SvnDiffCallback.OperationKind operation) private void
displayFirstGitPath
(OutputStream outputStream, String path1) private void
displayGitDiffHeader
(OutputStream outputStream, SvnDiffCallback.OperationKind operationKind, String path1, String path2, String copyFromPath) private void
displayGitDiffHeaderAdded
(OutputStream outputStream, String path1, String path2, String copyFromPath) private void
displayGitDiffHeaderCopied
(OutputStream outputStream, String path1, String path2, String copyFromPath) private void
displayGitDiffHeaderDeleted
(OutputStream outputStream, String path1, String path2, String copyFromPath) private void
displayGitDiffHeaderModified
(OutputStream outputStream, String path1, String path2, String copyFromPath) private void
displayGitDiffHeaderRenamed
(OutputStream outputStream, String path1, String path2, String copyFromPath) private void
displayGitHeaderFields
(OutputStream outputStream, SvnTarget target, String revision1, String revision2, SvnDiffCallback.OperationKind operation, String copyFromPath) private void
displayGitPath
(OutputStream outputStream, String path1, String pathPrefix, boolean label) protected boolean
displayHeader
(OutputStream os, String path, boolean deleted, boolean added, SvnDiffCallback.OperationKind operation) protected void
displayHeaderFields
(OutputStream os, String label1, String label2) private void
displayMergeInfoDiff
(OutputStream outputStream, String oldValue, String newValue) private void
displayMimeType
(OutputStream outputStream, String mimeType) private void
displayMimeTypes
(OutputStream outputStream, String mimeType1, String mimeType2) private void
displayPropDiffValues
(OutputStream outputStream, SVNProperties diff, SVNProperties baseProps) private void
displayPropertyChangesOn
(String path, OutputStream outputStream) void
displayPropsChanged
(SvnTarget target, String revision1, String revision2, boolean dirWasAdded, SVNProperties originalProps, SVNProperties propChanges, OutputStream outputStream) private void
displaySecondGitLabelPath
(OutputStream outputStream, String path2, String revision2, SvnDiffCallback.OperationKind operation) private void
displaySecondGitPath
(OutputStream outputStream, String path2) private void
displayString
(OutputStream outputStream, String s) private void
private String
getAdjustedPath
(String displayPath, String path1, String commonAncestor) private String
getAdjustedPathWithLabel
(String displayPath, String path, String revision, String commonAncestor) private String
getChildPath
(String path, String relativeToPath) private String
getDisplayPath
(SvnTarget target) byte[]
getEOL()
private String
private String
getGitDiffLabel1
(SvnDiffCallback.OperationKind operationKind, String path1, String path2, String copyFromPath, String revision) private String
getGitDiffLabel2
(SvnDiffCallback.OperationKind operationKind, String path1, String path2, String copyFromPath, String revision) private String
getHeaderFieldsString
(SvnTarget target, String displayPath, String label1, String label2, String revision1, String revision2, SvnDiffCallback.OperationKind operation, String copyFromPath) private String
getHeaderString
(SvnTarget target, String displayPath, boolean deleted, boolean added, SvnDiffCallback.OperationKind operation, String copyFromPath) protected String
private byte[]
getPropertyAsBytes
(SVNPropertyValue value, String encoding) private String
getRelativePath
(String targetString, String baseTargetString) private String
getRelativeToRootPath
(SvnTarget target, SvnTarget originalTarget) private void
internalDiff
(SvnTarget target, OutputStream outputStream, String displayPath, File file1, File file2, String label1, String label2, SvnDiffCallback.OperationKind operation, String copyFromPath, String revision1, String revision2) boolean
boolean
boolean
boolean
boolean
private byte[]
maybeAppendEOL
(byte[] buffer) private void
runExternalDiffCommand
(OutputStream outputStream, String diffCommand, File file1, File file2, String label1, String label2) void
setAnchors
(SvnTarget originalTarget1, SvnTarget originalTarget2) void
setBasePath
(File absoluteFile) void
setBaseTarget
(SvnTarget baseTarget) void
setDiffAdded
(boolean diffAdded) void
setDiffDeleted
(boolean diffDeleted) void
setDiffOptions
(SVNDiffOptions diffOptions) void
setEncoding
(String encoding) void
setEOL
(byte[] eol) void
setExternalDiffCommand
(String externalDiffCommand) void
setFallbackToAbsolutePath
(boolean fallbackToAbsolutePath) void
setForcedBinaryDiff
(boolean forcedBinaryDiff) void
setForceEmpty
(boolean forceEmpty) void
setIgnoreProperties
(boolean ignoreProperties) void
setOptions
(ISVNOptions options) void
setOriginalTargets
(SvnTarget originalTarget1, SvnTarget originalTarget2) void
setPropertiesOnly
(boolean propertiesOnly) void
setRawDiffOptions
(List<String> rawDiffOptions) void
setRelativeToTarget
(SvnTarget relativeToTarget) void
setRepositoryRoot
(SvnTarget repositoryRoot) void
setUseGitFormat
(boolean useGitFormat) private void
throwBadRelativePathException
(String displayPath, String relativeToPath) private boolean
private void
-
Field Details
-
WC_REVISION_LABEL
- See Also:
-
PROPERTIES_SEPARATOR
- See Also:
-
HEADER_SEPARATOR
- See Also:
-
HEADER_ENCODING
- See Also:
-
originalTarget1
-
originalTarget2
-
baseTarget
-
relativeToTarget
-
repositoryRoot
-
encoding
-
eol
private byte[] eol -
useGitFormat
private boolean useGitFormat -
forcedBinaryDiff
private boolean forcedBinaryDiff -
diffDeleted
private boolean diffDeleted -
diffAdded
private boolean diffAdded -
rawDiffOptions
-
forceEmpty
private boolean forceEmpty -
visitedPaths
-
externalDiffCommand
-
diffOptions
-
fallbackToAbsolutePath
private boolean fallbackToAbsolutePath -
options
-
propertiesOnly
private boolean propertiesOnly -
ignoreProperties
private boolean ignoreProperties
-
-
Constructor Details
-
SvnDiffGenerator
public SvnDiffGenerator()
-
-
Method Details
-
getDisplayPath
-
getRelativeToRootPath
-
getRelativePath
-
getChildPath
-
setBaseTarget
- Specified by:
setBaseTarget
in interfaceISvnDiffGenerator
-
setUseGitFormat
public void setUseGitFormat(boolean useGitFormat) - Specified by:
setUseGitFormat
in interfaceISvnDiffGenerator
-
setOriginalTargets
- Specified by:
setOriginalTargets
in interfaceISvnDiffGenerator
-
setRelativeToTarget
-
setAnchors
- Specified by:
setAnchors
in interfaceISvnDiffGenerator
-
setRepositoryRoot
- Specified by:
setRepositoryRoot
in interfaceISvnDiffGenerator
-
setForceEmpty
public void setForceEmpty(boolean forceEmpty) - Specified by:
setForceEmpty
in interfaceISvnDiffGenerator
-
setEncoding
- Specified by:
setEncoding
in interfaceISvnDiffGenerator
-
getEncoding
- Specified by:
getEncoding
in interfaceISvnDiffGenerator
-
getGlobalEncoding
- Specified by:
getGlobalEncoding
in interfaceISvnDiffGenerator
-
setEOL
public void setEOL(byte[] eol) - Specified by:
setEOL
in interfaceISvnDiffGenerator
-
getEOL
public byte[] getEOL()- Specified by:
getEOL
in interfaceISvnDiffGenerator
-
isForcedBinaryDiff
public boolean isForcedBinaryDiff()- Specified by:
isForcedBinaryDiff
in interfaceISvnDiffGenerator
-
setForcedBinaryDiff
public void setForcedBinaryDiff(boolean forcedBinaryDiff) - Specified by:
setForcedBinaryDiff
in interfaceISvnDiffGenerator
-
isPropertiesOnly
public boolean isPropertiesOnly() -
setPropertiesOnly
public void setPropertiesOnly(boolean propertiesOnly) -
isIgnoreProperties
public boolean isIgnoreProperties() -
setIgnoreProperties
public void setIgnoreProperties(boolean ignoreProperties) -
displayDeletedDirectory
public void displayDeletedDirectory(SvnTarget target, String revision1, String revision2, OutputStream outputStream) throws SVNException - Specified by:
displayDeletedDirectory
in interfaceISvnDiffGenerator
- Throws:
SVNException
-
displayAddedDirectory
public void displayAddedDirectory(SvnTarget target, String revision1, String revision2, OutputStream outputStream) throws SVNException - Specified by:
displayAddedDirectory
in interfaceISvnDiffGenerator
- Throws:
SVNException
-
displayPropsChanged
public void displayPropsChanged(SvnTarget target, String revision1, String revision2, boolean dirWasAdded, SVNProperties originalProps, SVNProperties propChanges, OutputStream outputStream) throws SVNException - Specified by:
displayPropsChanged
in interfaceISvnDiffGenerator
- Throws:
SVNException
-
throwBadRelativePathException
private void throwBadRelativePathException(String displayPath, String relativeToPath) throws SVNException - Throws:
SVNException
-
displayGitHeaderFields
private void displayGitHeaderFields(OutputStream outputStream, SvnTarget target, String revision1, String revision2, SvnDiffCallback.OperationKind operation, String copyFromPath) throws SVNException - Throws:
SVNException
-
adjustRelativeToReposRoot
-
computeLabel
-
displayContentChanged
public void displayContentChanged(SvnTarget target, File leftFile, File rightFile, String revision1, String revision2, String mimeType1, String mimeType2, SvnDiffCallback.OperationKind operation, File copyFromPath, SVNProperties originalProperties, SVNProperties propChanges, OutputStream outputStream) throws SVNException - Specified by:
displayContentChanged
in interfaceISvnDiffGenerator
- Throws:
SVNException
-
displayBinary
private void displayBinary(String mimeType1, String mimeType2, OutputStream outputStream, boolean leftIsBinary, boolean rightIsBinary) throws SVNException - Throws:
SVNException
-
internalDiff
private void internalDiff(SvnTarget target, OutputStream outputStream, String displayPath, File file1, File file2, String label1, String label2, SvnDiffCallback.OperationKind operation, String copyFromPath, String revision1, String revision2) throws SVNException - Throws:
SVNException
-
getHeaderFieldsString
private String getHeaderFieldsString(SvnTarget target, String displayPath, String label1, String label2, String revision1, String revision2, SvnDiffCallback.OperationKind operation, String copyFromPath) throws SVNException - Throws:
SVNException
-
getHeaderString
private String getHeaderString(SvnTarget target, String displayPath, boolean deleted, boolean added, SvnDiffCallback.OperationKind operation, String copyFromPath) throws SVNException - Throws:
SVNException
-
runExternalDiffCommand
private void runExternalDiffCommand(OutputStream outputStream, String diffCommand, File file1, File file2, String label1, String label2) throws SVNException - Throws:
SVNException
-
getExternalDiffCommand
-
displayMimeType
- Throws:
SVNException
-
displayMimeTypes
private void displayMimeTypes(OutputStream outputStream, String mimeType1, String mimeType2) throws SVNException - Throws:
SVNException
-
displayCannotDisplayFileMarkedBinary
- Throws:
SVNException
-
ensureEncodingAndEOLSet
private void ensureEncodingAndEOLSet() -
displayPropDiffValues
private void displayPropDiffValues(OutputStream outputStream, SVNProperties diff, SVNProperties baseProps) throws SVNException - Throws:
SVNException
-
maybeAppendEOL
private byte[] maybeAppendEOL(byte[] buffer) -
getGitDiffLabel1
-
getGitDiffLabel2
-
displayGitDiffHeader
private void displayGitDiffHeader(OutputStream outputStream, SvnDiffCallback.OperationKind operationKind, String path1, String path2, String copyFromPath) throws SVNException - Throws:
SVNException
-
displayGitDiffHeaderAdded
private void displayGitDiffHeaderAdded(OutputStream outputStream, String path1, String path2, String copyFromPath) throws SVNException - Throws:
SVNException
-
displayGitDiffHeaderDeleted
private void displayGitDiffHeaderDeleted(OutputStream outputStream, String path1, String path2, String copyFromPath) throws SVNException - Throws:
SVNException
-
displayGitDiffHeaderCopied
private void displayGitDiffHeaderCopied(OutputStream outputStream, String path1, String path2, String copyFromPath) throws SVNException - Throws:
SVNException
-
displayGitDiffHeaderRenamed
private void displayGitDiffHeaderRenamed(OutputStream outputStream, String path1, String path2, String copyFromPath) throws SVNException - Throws:
SVNException
-
displayGitDiffHeaderModified
private void displayGitDiffHeaderModified(OutputStream outputStream, String path1, String path2, String copyFromPath) throws SVNException - Throws:
SVNException
-
displayFirstGitPath
- Throws:
IOException
-
displaySecondGitPath
- Throws:
IOException
-
displayFirstGitLabelPath
private void displayFirstGitLabelPath(OutputStream outputStream, String path1, String revision1, SvnDiffCallback.OperationKind operation) throws IOException - Throws:
IOException
-
displaySecondGitLabelPath
private void displaySecondGitLabelPath(OutputStream outputStream, String path2, String revision2, SvnDiffCallback.OperationKind operation) throws IOException - Throws:
IOException
-
displayGitPath
private void displayGitPath(OutputStream outputStream, String path1, String pathPrefix, boolean label) throws IOException - Throws:
IOException
-
getAdjustedPathWithLabel
-
getAdjustedPath
-
getLabel
-
displayHeader
protected boolean displayHeader(OutputStream os, String path, boolean deleted, boolean added, SvnDiffCallback.OperationKind operation) throws SVNException - Throws:
SVNException
-
displayHeaderFields
protected void displayHeaderFields(OutputStream os, String label1, String label2) throws SVNException - Throws:
SVNException
-
displayPropertyChangesOn
- Throws:
SVNException
-
getPropertyAsBytes
-
displayMergeInfoDiff
private void displayMergeInfoDiff(OutputStream outputStream, String oldValue, String newValue) throws SVNException, IOException - Throws:
SVNException
IOException
-
useLocalFileSeparatorChar
private boolean useLocalFileSeparatorChar() -
isDiffDeleted
public boolean isDiffDeleted() -
isDiffAdded
public boolean isDiffAdded() -
wrapException
- Throws:
SVNException
-
displayString
- Throws:
IOException
-
displayEOL
- Throws:
IOException
-
getDiffOptions
-
setExternalDiffCommand
-
setRawDiffOptions
-
setDiffOptions
-
setDiffDeleted
public void setDiffDeleted(boolean diffDeleted) -
setDiffAdded
public void setDiffAdded(boolean diffAdded) -
setBasePath
-
setFallbackToAbsolutePath
public void setFallbackToAbsolutePath(boolean fallbackToAbsolutePath) -
setOptions
-
getOptions
-