public void displayPropDiff(String path, SVNProperties baseProps, SVNProperties diff, OutputStream result) throws SVNException {
baseProps = baseProps != null ? baseProps : new SVNProperties();
diff = diff != null ? diff : new SVNProperties();
for (Iterator changedPropNames = diff.nameSet().iterator(); changedPropNames.hasNext();) {
String name = (String) changedPropNames.next();
SVNPropertyValue originalValue = baseProps.getSVNPropertyValue(name);
SVNPropertyValue newValue = diff.getSVNPropertyValue(name);
if ((originalValue != null && originalValue.equals(newValue)) || (originalValue == null && newValue == null)) {
changedPropNames.remove();
}
}
if (diff.isEmpty()) {
return;
}
path = getDisplayPath(path);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
diff = new SVNProperties(diff);
try {
bos.write(getEOL());
bos.write(("Property changes on: " + (useLocalFileSeparatorChar() ? path.replace('/', File.separatorChar) : path)).getBytes(getEncoding()));
bos.write(getEOL());
bos.write(PROPERTIES_SEPARATOR);
bos.write(getEOL());
for (Iterator changedPropNames = diff.nameSet().iterator(); changedPropNames.hasNext();) {
String name = (String) changedPropNames.next();
SVNPropertyValue originalValue = baseProps != null ? baseProps.getSVNPropertyValue(name) : null;
SVNPropertyValue newValue = diff.getSVNPropertyValue(name);
String headerFormat = null;
if (originalValue == null) {
headerFormat = "Added: ";
} else if (newValue == null) {
headerFormat = "Deleted: ";
} else {
headerFormat = "Modified: ";
}
bos.write((headerFormat + name).getBytes(getEncoding()));
bos.write(getEOL());
if (SVNProperty.MERGE_INFO.equals(name)) {
displayMergeInfoDiff(bos, originalValue == null ? null : originalValue.getString(), newValue == null ? null : newValue.getString());
continue;
}
if (originalValue != null) {
bos.write(" - ".getBytes(getEncoding()));
bos.write(getPropertyAsBytes(originalValue, getEncoding()));