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 SvnTargetprivate booleanprivate booleanprivate SVNDiffOptionsprivate Stringprivate byte[]private Stringprivate booleanprivate booleanprivate booleanprotected static final Stringprotected static final Stringprivate booleanprivate ISVNOptionsprivate SvnTargetprivate SvnTargetprotected static final Stringprivate booleanprivate SvnTargetprivate SvnTargetprivate booleanprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringadjustRelativeToReposRoot(String targetString) private StringcomputeLabel(String targetString, String originalTargetString) voiddisplayAddedDirectory(SvnTarget target, String revision1, String revision2, OutputStream outputStream) private voiddisplayBinary(String mimeType1, String mimeType2, OutputStream outputStream, boolean leftIsBinary, boolean rightIsBinary) private voiddisplayCannotDisplayFileMarkedBinary(OutputStream outputStream) voiddisplayContentChanged(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) voiddisplayDeletedDirectory(SvnTarget target, String revision1, String revision2, OutputStream outputStream) private voidprivate voiddisplayFirstGitLabelPath(OutputStream outputStream, String path1, String revision1, SvnDiffCallback.OperationKind operation) private voiddisplayFirstGitPath(OutputStream outputStream, String path1) private voiddisplayGitDiffHeader(OutputStream outputStream, SvnDiffCallback.OperationKind operationKind, String path1, String path2, String copyFromPath) private voiddisplayGitDiffHeaderAdded(OutputStream outputStream, String path1, String path2, String copyFromPath) private voiddisplayGitDiffHeaderCopied(OutputStream outputStream, String path1, String path2, String copyFromPath) private voiddisplayGitDiffHeaderDeleted(OutputStream outputStream, String path1, String path2, String copyFromPath) private voiddisplayGitDiffHeaderModified(OutputStream outputStream, String path1, String path2, String copyFromPath) private voiddisplayGitDiffHeaderRenamed(OutputStream outputStream, String path1, String path2, String copyFromPath) private voiddisplayGitHeaderFields(OutputStream outputStream, SvnTarget target, String revision1, String revision2, SvnDiffCallback.OperationKind operation, String copyFromPath) private voiddisplayGitPath(OutputStream outputStream, String path1, String pathPrefix, boolean label) protected booleandisplayHeader(OutputStream os, String path, boolean deleted, boolean added, SvnDiffCallback.OperationKind operation) protected voiddisplayHeaderFields(OutputStream os, String label1, String label2) private voiddisplayMergeInfoDiff(OutputStream outputStream, String oldValue, String newValue) private voiddisplayMimeType(OutputStream outputStream, String mimeType) private voiddisplayMimeTypes(OutputStream outputStream, String mimeType1, String mimeType2) private voiddisplayPropDiffValues(OutputStream outputStream, SVNProperties diff, SVNProperties baseProps) private voiddisplayPropertyChangesOn(String path, OutputStream outputStream) voiddisplayPropsChanged(SvnTarget target, String revision1, String revision2, boolean dirWasAdded, SVNProperties originalProps, SVNProperties propChanges, OutputStream outputStream) private voiddisplaySecondGitLabelPath(OutputStream outputStream, String path2, String revision2, SvnDiffCallback.OperationKind operation) private voiddisplaySecondGitPath(OutputStream outputStream, String path2) private voiddisplayString(OutputStream outputStream, String s) private voidprivate StringgetAdjustedPath(String displayPath, String path1, String commonAncestor) private StringgetAdjustedPathWithLabel(String displayPath, String path, String revision, String commonAncestor) private StringgetChildPath(String path, String relativeToPath) private StringgetDisplayPath(SvnTarget target) byte[]getEOL()private Stringprivate StringgetGitDiffLabel1(SvnDiffCallback.OperationKind operationKind, String path1, String path2, String copyFromPath, String revision) private StringgetGitDiffLabel2(SvnDiffCallback.OperationKind operationKind, String path1, String path2, String copyFromPath, String revision) private StringgetHeaderFieldsString(SvnTarget target, String displayPath, String label1, String label2, String revision1, String revision2, SvnDiffCallback.OperationKind operation, String copyFromPath) private StringgetHeaderString(SvnTarget target, String displayPath, boolean deleted, boolean added, SvnDiffCallback.OperationKind operation, String copyFromPath) protected Stringprivate byte[]getPropertyAsBytes(SVNPropertyValue value, String encoding) private StringgetRelativePath(String targetString, String baseTargetString) private StringgetRelativeToRootPath(SvnTarget target, SvnTarget originalTarget) private voidinternalDiff(SvnTarget target, OutputStream outputStream, String displayPath, File file1, File file2, String label1, String label2, SvnDiffCallback.OperationKind operation, String copyFromPath, String revision1, String revision2) booleanbooleanbooleanbooleanbooleanprivate byte[]maybeAppendEOL(byte[] buffer) private voidrunExternalDiffCommand(OutputStream outputStream, String diffCommand, File file1, File file2, String label1, String label2) voidsetAnchors(SvnTarget originalTarget1, SvnTarget originalTarget2) voidsetBasePath(File absoluteFile) voidsetBaseTarget(SvnTarget baseTarget) voidsetDiffAdded(boolean diffAdded) voidsetDiffDeleted(boolean diffDeleted) voidsetDiffOptions(SVNDiffOptions diffOptions) voidsetEncoding(String encoding) voidsetEOL(byte[] eol) voidsetExternalDiffCommand(String externalDiffCommand) voidsetFallbackToAbsolutePath(boolean fallbackToAbsolutePath) voidsetForcedBinaryDiff(boolean forcedBinaryDiff) voidsetForceEmpty(boolean forceEmpty) voidsetIgnoreProperties(boolean ignoreProperties) voidsetOptions(ISVNOptions options) voidsetOriginalTargets(SvnTarget originalTarget1, SvnTarget originalTarget2) voidsetPropertiesOnly(boolean propertiesOnly) voidsetRawDiffOptions(List<String> rawDiffOptions) voidsetRelativeToTarget(SvnTarget relativeToTarget) voidsetRepositoryRoot(SvnTarget repositoryRoot) voidsetUseGitFormat(boolean useGitFormat) private voidthrowBadRelativePathException(String displayPath, String relativeToPath) private booleanprivate 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:
setBaseTargetin interfaceISvnDiffGenerator
-
setUseGitFormat
public void setUseGitFormat(boolean useGitFormat) - Specified by:
setUseGitFormatin interfaceISvnDiffGenerator
-
setOriginalTargets
- Specified by:
setOriginalTargetsin interfaceISvnDiffGenerator
-
setRelativeToTarget
-
setAnchors
- Specified by:
setAnchorsin interfaceISvnDiffGenerator
-
setRepositoryRoot
- Specified by:
setRepositoryRootin interfaceISvnDiffGenerator
-
setForceEmpty
public void setForceEmpty(boolean forceEmpty) - Specified by:
setForceEmptyin interfaceISvnDiffGenerator
-
setEncoding
- Specified by:
setEncodingin interfaceISvnDiffGenerator
-
getEncoding
- Specified by:
getEncodingin interfaceISvnDiffGenerator
-
getGlobalEncoding
- Specified by:
getGlobalEncodingin interfaceISvnDiffGenerator
-
setEOL
public void setEOL(byte[] eol) - Specified by:
setEOLin interfaceISvnDiffGenerator
-
getEOL
public byte[] getEOL()- Specified by:
getEOLin interfaceISvnDiffGenerator
-
isForcedBinaryDiff
public boolean isForcedBinaryDiff()- Specified by:
isForcedBinaryDiffin interfaceISvnDiffGenerator
-
setForcedBinaryDiff
public void setForcedBinaryDiff(boolean forcedBinaryDiff) - Specified by:
setForcedBinaryDiffin 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:
displayDeletedDirectoryin interfaceISvnDiffGenerator- Throws:
SVNException
-
displayAddedDirectory
public void displayAddedDirectory(SvnTarget target, String revision1, String revision2, OutputStream outputStream) throws SVNException - Specified by:
displayAddedDirectoryin 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:
displayPropsChangedin 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:
displayContentChangedin 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:
SVNExceptionIOException
-
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
-