return new SVNProperties();
}
public void saveVersionedProperties(SVNLog log, boolean close) throws SVNException {
SVNProperties command = new SVNProperties();
Set processedEntries = new SVNHashSet();
Map propsCache = getPropertiesStorage(false);
if (propsCache != null && !propsCache.isEmpty()) {
for(Iterator entries = propsCache.keySet().iterator(); entries.hasNext();) {
String name = (String)entries.next();
SVNVersionedProperties props = (SVNVersionedProperties)propsCache.get(name);
if (props.isModified()) {
SVNVersionedProperties baseProps = getBaseProperties(name);
SVNVersionedProperties propsDiff = baseProps.compareTo(props);
String[] cachableProps = SVNAdminArea14.getCachableProperties();
command.put(SVNProperty.shortPropertyName(SVNProperty.CACHABLE_PROPS),
asString(cachableProps, " "));
SVNProperties propsMap = props.loadProperties();
LinkedList presentProps = new LinkedList();
for (int i = 0; i < cachableProps.length; i++) {
if (propsMap.containsName(cachableProps[i])) {
presentProps.addLast(cachableProps[i]);
}
}
if (presentProps.size() > 0) {
String presentPropsString = asString((String[])presentProps.toArray(new String[presentProps.size()]), " ");
command.put(SVNProperty.shortPropertyName(SVNProperty.PRESENT_PROPS), presentPropsString);
} else {
command.put(SVNProperty.shortPropertyName(SVNProperty.PRESENT_PROPS), "");
}
command.put(SVNProperty.shortPropertyName(SVNProperty.HAS_PROPS),
SVNProperty.toString(!props.isEmpty()));
boolean hasPropModifications = !propsDiff.isEmpty();
command.put(SVNProperty.shortPropertyName(SVNProperty.HAS_PROP_MODS), SVNProperty.toString(hasPropModifications));
command.put(SVNLog.NAME_ATTR, name);
log.addCommand(SVNLog.MODIFY_ENTRY, command, false);
processedEntries.add(name);
command.clear();
String dstPath = getThisDirName().equals(name) ? "dir-props" : "props/" + name + ".svn-work";
dstPath = getAdminDirectory().getName() + "/" + dstPath;
if (hasPropModifications) {
String tmpPath = "tmp/";
tmpPath += getThisDirName().equals(name) ? "dir-props" : "props/" + name + ".svn-work";
File tmpFile = getAdminFile(tmpPath);
String srcPath = getAdminDirectory().getName() + "/" + tmpPath;
SVNWCProperties tmpProps = new SVNWCProperties(tmpFile, srcPath);
if (!props.isEmpty()) {
tmpProps.setProperties(props.asMap());
} else {
SVNFileUtil.createEmptyFile(tmpFile);
}
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.shortPropertyName(SVNProperty.CACHABLE_PROPS), asString(cachableProps, " "));