File tmpCharsetPropFile = SVNAdminUtil.createTmpFile(this, "props", ".tmp", true);
String tmpCharsetPropPath = SVNPathUtil.getRelativePath(getRoot().getAbsolutePath(), tmpCharsetPropFile.getAbsolutePath());
if (getFormatVersion() == SVNAdminArea15Factory.WC_FORMAT) {
baseProps.setPropertyValue(SVNProperty.CHARSET, SVNPropertyValue.create("UTF-8"));
SVNWCProperties propFile = new SVNWCProperties(tmpCharsetPropFile, tmpCharsetPropPath);
propFile.setProperties(baseProps.asMap());
baseProps.setPropertyValue(SVNProperty.CHARSET, charsetProp);
File tmpBaseFile = SVNAdminUtil.createTmpFile(this, entry.getName(), ".tmp", true);
String tmpBasePath = SVNPathUtil.getRelativePath(getRoot().getAbsolutePath(), tmpBaseFile.getAbsolutePath());
command.put(SVNLog.NAME_ATTR, SVNAdminUtil.getPropBasePath(entry.getName(), SVNNodeKind.FILE, false));
command.put(SVNLog.DEST_ATTR, tmpBasePath);
log.addCommand(SVNLog.COPY, command, false);
command.clear();
command.put(SVNLog.NAME_ATTR, tmpCharsetPropPath);
command.put(SVNLog.DEST_ATTR, SVNAdminUtil.getPropBasePath(entry.getName(), SVNNodeKind.FILE, false));
log.addCommand(SVNLog.MOVE, command, false);
command.clear();
command.put(SVNLog.NAME_ATTR, entry.getName());
command.put(SVNLog.DEST_ATTR, detranslatedPath);
log.addCommand(SVNLog.COPY_AND_DETRANSLATE, command, false);
command.clear();
command.put(SVNLog.DEST_ATTR, SVNAdminUtil.getPropBasePath(entry.getName(), SVNNodeKind.FILE, false));
command.put(SVNLog.NAME_ATTR, tmpBasePath);
log.addCommand(SVNLog.MOVE, command, false);
command.clear();
command.put(SVNLog.NAME_ATTR, detranslatedPath);
command.put(SVNLog.DEST_ATTR, entry.getName());
log.addCommand(SVNLog.COPY_AND_TRANSLATE, command, false);
command.clear();
command.put(SVNLog.NAME_ATTR, detranslatedPath);
log.addCommand(SVNLog.DELETE, command, false);
command.clear();
} else if (adminArea.getFormatVersion() == SVNAdminArea15Factory.WC_FORMAT) {
command.put(SVNLog.NAME_ATTR, entry.getName());
command.put(SVNLog.DEST_ATTR, detranslatedPath);
log.addCommand(SVNLog.COPY_AND_DETRANSLATE, command, false);
command.clear();
baseProps.setPropertyValue(SVNProperty.CHARSET, SVNPropertyValue.create("UTF-8"));
SVNWCProperties propFile = new SVNWCProperties(tmpCharsetPropFile, tmpCharsetPropPath);
propFile.setProperties(baseProps.asMap());
baseProps.setPropertyValue(SVNProperty.CHARSET, charsetProp);
command.put(SVNLog.NAME_ATTR, tmpCharsetPropPath);
command.put(SVNLog.DEST_ATTR, SVNAdminUtil.getPropBasePath(entry.getName(), SVNNodeKind.FILE, false));
log.addCommand(SVNLog.MOVE, command, false);