InputStream srcIS = null;
OutputStream copiedBaseOS = null;
try {
srcIS = SVNFileUtil.openFileForReading(srcArea.getFile(srcTextBasePath));
copiedBaseOS = SVNFileUtil.openFileForWriting(info.copiedBaseText);
SVNChecksumOutputStream checksumOS = new SVNChecksumOutputStream(copiedBaseOS,
SVNChecksumOutputStream.MD5_ALGORITHM, true);
copiedBaseOS = checksumOS;
FSRepositoryUtil.copy(srcIS, copiedBaseOS, myWCAccess);
info.copiedBaseChecksum = checksumOS.getDigest();
} finally {
SVNFileUtil.closeFile(srcIS);
SVNFileUtil.closeFile(copiedBaseOS);
}
if (srcArea.hasTextModifications(srcEntry.getName(), false, true, false)) {
info.copiedWorkingText = SVNAdminUtil.createTmpFile(adminArea);
SVNFileUtil.copyFile(srcArea.getFile(srcEntry.getName()), info.copiedWorkingText, true);
}
} else {
if (myFileFetcher == null) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_INVALID_OP_ON_CWD,
"No fetch_func supplied to update_editor.");
SVNErrorManager.error(err, SVNLogType.DEFAULT);
}
baseProperties = new SVNProperties();
OutputStream baseTextOS = null;
try {
baseTextOS = SVNFileUtil.openFileForWriting(info.copiedBaseText);
SVNChecksumOutputStream checksumBaseTextOS = new SVNChecksumOutputStream(baseTextOS,
SVNChecksumOutputStream.MD5_ALGORITHM, true);
baseTextOS = checksumBaseTextOS;
myFileFetcher.fetchFile(copyFromPath, copyFromRevision, baseTextOS, baseProperties);
info.copiedBaseChecksum = checksumBaseTextOS.getDigest();
} finally {
SVNFileUtil.closeFile(baseTextOS);
}
workingProperties = baseProperties;