}
private boolean revert(SVNAdminArea dir, String name, SVNEntry entry, boolean useCommitTime) throws SVNException {
SVNLog log = dir.getLog();
boolean reverted = false;
SVNVersionedProperties baseProperties = null;
SVNProperties command = new SVNProperties();
boolean revertBase = false;
if (entry.isScheduledForReplacement()) {
revertBase = true;
baseProperties = dir.getRevertProperties(name);
String propRevertPath = SVNAdminUtil.getPropRevertPath(name, entry.getKind(), false);
command.put(SVNLog.NAME_ATTR, propRevertPath);
log.addCommand(SVNLog.DELETE, command, false);
command.clear();
reverted = true;
}
boolean reinstallWorkingFile = false;
if (baseProperties == null) {
if (dir.hasPropModifications(name)) {
baseProperties = dir.getBaseProperties(name);
SVNVersionedProperties propDiff = dir.getProperties(name).compareTo(baseProperties);
Collection propNames = propDiff.getPropertyNames(null);
reinstallWorkingFile = propNames.contains(SVNProperty.EXECUTABLE) ||
propNames.contains(SVNProperty.KEYWORDS) ||
propNames.contains(SVNProperty.EOL_STYLE) ||
propNames.contains(SVNProperty.CHARSET) ||
propNames.contains(SVNProperty.SPECIAL) ||
propNames.contains(SVNProperty.NEEDS_LOCK);
}
}
if (baseProperties != null) {
// save base props both to base and working.
SVNProperties newProperties = baseProperties.asMap();
SVNVersionedProperties originalBaseProperties = dir.getBaseProperties(name);
SVNVersionedProperties workProperties = dir.getProperties(name);
if (revertBase) {
originalBaseProperties.removeAll();
}
workProperties.removeAll();
for (Iterator names = newProperties.nameSet().iterator(); names.hasNext();) {
String propName = (String) names.next();
if (revertBase) {
originalBaseProperties.setPropertyValue(propName, newProperties.getSVNPropertyValue(propName));
}
workProperties.setPropertyValue(propName, newProperties.getSVNPropertyValue(propName));
}
dir.saveVersionedProperties(log, false);
reverted = true;
}
SVNProperties newEntryProperties = new SVNProperties();