byte[] conflictStart = ("<<<<<<< " + localLabel).getBytes();
byte[] conflictEnd = (">>>>>>> " + latestLabel).getBytes();
byte[] separator = ("=======").getBytes();
ISVNMergerFactory factory = myWCAccess.getOptions().getMergerFactory();
ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);
String workingText = localPath;
if (copyFromText != null) {
String copyFromTextPath = copyFromText.getAbsolutePath().replace(File.separatorChar, '/');
String thisPath = getRoot().getAbsolutePath().replace(File.separatorChar, '/');
workingText = copyFromTextPath.substring(thisPath.length());
if (workingText.startsWith("/")) {
workingText = workingText.substring(1);
}
}
File tmpTarget = SVNTranslator.detranslateWorkingCopy(this, workingText, propChanges, false);
base = SVNTranslator.maybeUpdateTargetEOLs(this, base, propChanges);
File resultFile = SVNAdminUtil.createTmpFile(this);
SVNMergeFileSet mergeFileSet = new SVNMergeFileSet(this, log, base, tmpTarget, localPath, latest,
resultFile, copyFromText, mimeType);
mergeFileSet.setMergeLabels(baseLabel, localLabel, latestLabel);
SVNMergeResult mergeResult;
try {
mergeResult = merger.mergeText(mergeFileSet, dryRun, options);
}
finally {
if (dryRun) {
SVNFileUtil.deleteFile(resultFile);
}