SVNErrorManager.error(err, SVNLogType.WC);
}
SVNEntry dstEntry = dir.getEntry(fileName, false);
SVNLog log = dir.getLog();
SVNProperties command = new SVNProperties();
if (dstEntry != null && dstEntry.isScheduledForDeletion()) {
String revertTextPath = SVNAdminUtil.getTextRevertPath(fileName, false);
String baseTextPath = SVNAdminUtil.getTextBasePath(fileName, false);
String revertPropsPath = SVNAdminUtil.getPropRevertPath(fileName, SVNNodeKind.FILE, false);
String basePropsPath = SVNAdminUtil.getPropBasePath(fileName, SVNNodeKind.FILE, false);
command.put(SVNLog.NAME_ATTR, baseTextPath);
command.put(SVNLog.DEST_ATTR, revertTextPath);
log.addCommand(SVNLog.MOVE, command, false);
command.clear();
if (dir.getFile(basePropsPath).isFile()) {
command.put(SVNLog.NAME_ATTR, basePropsPath);
command.put(SVNLog.DEST_ATTR, revertPropsPath);
log.addCommand(SVNLog.MOVE, command, false);
command.clear();
} else {
String emptyPropPath = SVNAdminUtil.getPropBasePath(fileName, SVNNodeKind.FILE, false);
SVNWCProperties.setProperties(new SVNProperties(), null, dir.getFile(emptyPropPath),
SVNWCProperties.SVN_HASH_TERMINATOR);
command.put(SVNLog.NAME_ATTR, emptyPropPath);
command.put(SVNLog.DEST_ATTR, revertPropsPath);
log.addCommand(SVNLog.MOVE, command, false);
command.clear();
}
}
SVNProperties entryAttrs = new SVNProperties();
entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.SCHEDULE), SVNProperty.SCHEDULE_ADD);
if (copyFromURL != null) {
entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.COPIED), SVNProperty.toString(true));
entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.COPYFROM_URL), copyFromURL);
entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.COPYFROM_REVISION), SVNProperty.toString(copyFromRev));
}
log.logChangedEntryProperties(fileName, entryAttrs);
entryAttrs.clear();
log.logTweakEntry(fileName, newURL, dstEntry != null ? dstEntry.getRevision() : parentEntry.getRevision());
SVNWCManager.addProperties(dir, fileName, baseProperties, true, log);
SVNWCManager.addProperties(dir, fileName, properties, false, log);
File tmpTextBase = dir.getBaseFile(fileName, true);
if (!tmpTextBase.equals(textBase) && textBase != null) {
SVNFileUtil.rename(textBase, tmpTextBase);
}
if (text != null) {
File tmpFile = SVNFileUtil.createUniqueFile(dir.getRoot(), fileName, ".tmp", false);
SVNFileUtil.rename(text, tmpFile);
if (baseProperties != null && baseProperties.containsName(SVNProperty.SPECIAL)) {
command.put(SVNLog.NAME_ATTR, tmpFile.getName());
command.put(SVNLog.DEST_ATTR, fileName);
command.put(SVNLog.ATTR1, "true");
log.addCommand(SVNLog.COPY, command, false);
command.clear();
command.put(SVNLog.NAME_ATTR, tmpFile.getName());
log.addCommand(SVNLog.DELETE, command, false);
command.clear();
} else {
command.put(SVNLog.NAME_ATTR, tmpFile.getName());
command.put(SVNLog.DEST_ATTR, fileName);
log.addCommand(SVNLog.MOVE, command, false);
command.clear();
}
} else {
command.put(SVNLog.NAME_ATTR, SVNAdminUtil.getTextBasePath(fileName, true));
command.put(SVNLog.DEST_ATTR, fileName);
log.addCommand(SVNLog.COPY_AND_TRANSLATE, command, false);
command.clear();
command.put(SVNProperty.shortPropertyName(SVNProperty.TEXT_TIME), SVNLog.WC_TIMESTAMP);
command.put(SVNProperty.shortPropertyName(SVNProperty.WORKING_SIZE), SVNLog.WC_WORKING_SIZE);
log.logChangedEntryProperties(fileName, command);
command.clear();
}
command.put(SVNLog.NAME_ATTR, SVNAdminUtil.getTextBasePath(fileName, true));
command.put(SVNLog.DEST_ATTR, SVNAdminUtil.getTextBasePath(fileName, false));
log.addCommand(SVNLog.MOVE, command, false);
command.clear();
command.put(SVNLog.NAME_ATTR, SVNAdminUtil.getTextBasePath(fileName, false));
log.addCommand(SVNLog.READONLY, command, false);
command.clear();
String checksum = SVNFileUtil.computeChecksum(dir.getBaseFile(fileName, true));
entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.CHECKSUM), checksum);
log.logChangedEntryProperties(fileName, entryAttrs);
entryAttrs.clear();
log.save();
dir.runLogs();
}