if (hasPropModifications) {
String tmpPath = "tmp/";
tmpPath += getThisDirName().equals(name) ? "dir-props" : "props/" + name + ".svn-work";
File tmpFile = getAdminFile(tmpPath);
String srcPath = getAdminDirectory().getName() + "/" + tmpPath;
SVNProperties tmpProps = new SVNProperties(tmpFile, srcPath);
tmpProps.setProperties(props.asMap());
command.put(SVNLog.NAME_ATTR, srcPath);
command.put(SVNLog.DEST_ATTR, dstPath);
log.addCommand(SVNLog.MOVE, command, false);
command.clear();
command.put(SVNLog.NAME_ATTR, dstPath);
log.addCommand(SVNLog.READONLY, command, false);
} else {
command.put(SVNLog.NAME_ATTR, dstPath);
log.addCommand(SVNLog.DELETE, command, false);
}
command.clear();
props.setModified(false);
}
}
}
Map basePropsCache = getBasePropertiesStorage(false);
if (basePropsCache != null && !basePropsCache.isEmpty()) {
for(Iterator entries = basePropsCache.keySet().iterator(); entries.hasNext();) {
String name = (String)entries.next();
SVNVersionedProperties baseProps = (SVNVersionedProperties)basePropsCache.get(name);
if (baseProps.isModified()) {
String dstPath = getThisDirName().equals(name) ? "dir-prop-base" : "prop-base/" + name + ".svn-base";
dstPath = getAdminDirectory().getName() + "/" + dstPath;
boolean isEntryProcessed = processedEntries.contains(name);
if (!isEntryProcessed) {
SVNVersionedProperties props = getProperties(name);
String[] cachableProps = SVNAdminArea14.getCachableProperties();
command.put(SVNProperty.CACHABLE_PROPS, asString(cachableProps, " "));
Map propsMap = props.loadProperties();
LinkedList presentProps = new LinkedList();
for (int i = 0; i < cachableProps.length; i++) {
if (propsMap.containsKey(cachableProps[i])) {
presentProps.addLast(cachableProps[i]);
}
}
if (presentProps.size() > 0) {
String presentPropsString = asString((String[])presentProps.toArray(new String[presentProps.size()]), " ");
command.put(SVNProperty.PRESENT_PROPS, presentPropsString);
} else {
command.put(SVNProperty.PRESENT_PROPS, "");
}
command.put(SVNProperty.HAS_PROPS, SVNProperty.toString(!props.isEmpty()));
SVNVersionedProperties propsDiff = baseProps.compareTo(props);
boolean hasPropModifications = !propsDiff.isEmpty();
command.put(SVNProperty.HAS_PROP_MODS, SVNProperty.toString(hasPropModifications));
command.put(SVNLog.NAME_ATTR, name);
log.addCommand(SVNLog.MODIFY_ENTRY, command, false);
command.clear();
if (!hasPropModifications) {
String workingPropsPath = getThisDirName().equals(name) ? "dir-props" : "props/" + name + ".svn-work";
workingPropsPath = getAdminDirectory().getName() + "/" + workingPropsPath;
command.put(SVNLog.NAME_ATTR, workingPropsPath);
log.addCommand(SVNLog.DELETE, command, false);
command.clear();
}
}
if (baseProps.isEmpty()) {
command.put(SVNLog.NAME_ATTR, dstPath);
log.addCommand(SVNLog.DELETE, command, false);
} else {
String tmpPath = "tmp/";
tmpPath += getThisDirName().equals(name) ? "dir-prop-base" : "prop-base/" + name + ".svn-base";
File tmpFile = getAdminFile(tmpPath);
String srcPath = getAdminDirectory().getName() + "/" + tmpPath;
SVNProperties tmpProps = new SVNProperties(tmpFile, srcPath);
tmpProps.setProperties(baseProps.asMap());
command.put(SVNLog.NAME_ATTR, srcPath);
command.put(SVNLog.DEST_ATTR, dstPath);
log.addCommand(SVNLog.MOVE, command, false);
command.clear();