public SVNStatusType[] fileChanged(String path, File file1, File file2, long revision1, long revision2, String mimeType1,
String mimeType2, SVNProperties originalProperties, SVNProperties diff, boolean[] isTreeConflicted) throws SVNException {
setIsConflicted(isTreeConflicted, false);
boolean needsMerge = true;
File mergedFile = getFile(path);
SVNAdminArea dir = retrieve(mergedFile.getParentFile(), myIsDryRun);
if (dir == null) {
return new SVNStatusType[] {SVNStatusType.MISSING, SVNStatusType.MISSING};
}
SVNStatusType obstructedStatus = getStatusForObstructedOrMissing(path);
if (obstructedStatus != SVNStatusType.INAPPLICABLE) {
return new SVNStatusType[] { obstructedStatus, SVNStatusType.UNCHANGED };
}
SVNStatusType[] result = new SVNStatusType[] {SVNStatusType.UNCHANGED, SVNStatusType.UNCHANGED};
SVNEntry entry = getWCAccess().getEntry(mergedFile, false);
SVNFileType fileType = null;
if (entry != null) {
fileType = SVNFileType.getType(mergedFile);
}
if (entry == null || (fileType != SVNFileType.FILE && fileType != SVNFileType.SYMLINK)) {
myMergeDriver.recordTreeConflict(mergedFile, dir, SVNNodeKind.FILE, SVNConflictAction.EDIT, SVNConflictReason.MISSING);
setIsConflicted(isTreeConflicted, true);
return new SVNStatusType[] {SVNStatusType.MISSING, SVNStatusType.MISSING};
}
if (diff != null && !diff.isEmpty()) {
boolean[] isTreeConflicted2 = { false };
result[1] = propertiesChanged(path, originalProperties, diff, isTreeConflicted2);
if (isTreeConflicted2[0]) {
setIsConflicted(isTreeConflicted, true);
return result;
}
}
String name = mergedFile.getName();
if (file1 != null) {
boolean textModified = dir.hasTextModifications(name, false);
if (!textModified &&
(SVNProperty.isBinaryMimeType(mimeType1) || SVNProperty.isBinaryMimeType(mimeType2))) {
boolean same = SVNFileUtil.compareFiles(!myIsAddNecessitatedMerge ? file1 : file2, mergedFile, null);
if (same) {
if (!myIsDryRun && !myIsAddNecessitatedMerge) {
SVNFileUtil.rename(file2, mergedFile);
}
result[0] = SVNStatusType.CHANGED;
needsMerge = false;
}
}
if (needsMerge) {
String localLabel = ".working";
String baseLabel = ".merge-left.r" + revision1;
String latestLabel = ".merge-right.r" + revision2;
SVNStatusType mergeResult = dir.mergeText(name, file1, file2, null, localLabel,
baseLabel, latestLabel, diff, myIsDryRun, myDiffOptions, null);
dir.runLogs();
if (mergeResult == SVNStatusType.CONFLICTED || mergeResult == SVNStatusType.CONFLICTED_UNRESOLVED) {
result[0] = mergeResult;
} else if (textModified && mergeResult != SVNStatusType.UNCHANGED) {
result[0] = SVNStatusType.MERGED;
} else if (mergeResult == SVNStatusType.MERGED) {