SVNDebugLog.getDefaultLog().info("wc props: " + workingProps);
    public SVNStatusType mergeProperties(String name, Map serverBaseProps, Map propDiff, boolean baseMerge, boolean dryRun, SVNLog log) throws SVNException {        serverBaseProps = serverBaseProps == null ? Collections.EMPTY_MAP : serverBaseProps;        propDiff = propDiff == null ? Collections.EMPTY_MAP : propDiff;                SVNVersionedProperties working = getProperties(name);        Map workingProps = working.asMap();        SVNDebugLog.getDefaultLog().info("wc props: " + workingProps);        SVNVersionedProperties base = getBaseProperties(name);        Collection conflicts = new ArrayList();        SVNStatusType result = propDiff.isEmpty() ? SVNStatusType.UNCHANGED : SVNStatusType.CHANGED;                for (Iterator propEntries = propDiff.entrySet().iterator(); propEntries.hasNext();) {            Map.Entry incomingEntry = (Map.Entry) propEntries.next();            String propName = (String) incomingEntry.getKey();            String toValue = (String) incomingEntry.getValue();            String fromValue = (String) serverBaseProps.get(propName);            String workingValue = (String) workingProps.get(propName);            boolean isNormal = SVNProperty.isRegularProperty(propName);             if (baseMerge) {                base.setPropertyValue(propName, toValue);            }                        result = isNormal ? SVNStatusType.CHANGED : result;            if (fromValue == null) {                if (workingValue != null) {                    if (workingValue.equals(toValue)) {                        result = result != SVNStatusType.CONFLICTED && isNormal ? SVNStatusType.MERGED : result;                    } else {                        result = isNormal ? SVNStatusType.CONFLICTED : result;                                                    conflicts.add(MessageFormat.format("Trying to add new property ''{0}'' with value ''{1}'',\n" +                                "but property already exists with value ''{2}''.", new Object[] { propName, toValue, workingValue }));                    }                } else {                    working.setPropertyValue(propName, toValue);                }            } else {                if (workingValue == null) {                    if (toValue != null) {                        result = isNormal ? SVNStatusType.CONFLICTED : result;                                                    conflicts.add(MessageFormat.format("Trying to change property ''{0}'' from ''{1}'' to ''{2}'',\n" +                                "but the property does not exist.", new Object[] { propName, fromValue, toValue }));                    } else {                        result = result != SVNStatusType.CONFLICTED && isNormal ? SVNStatusType.MERGED : result;                    }                } else {                    if (workingValue.equals(fromValue)) {                        working.setPropertyValue(propName, toValue);                    } else if (toValue == null && !workingValue.equals(fromValue)) {                        result = isNormal ? SVNStatusType.CONFLICTED : result;                        conflicts.add(MessageFormat.format("Trying to delete property ''{0}'' but value has been modified from ''{1}'' to ''{2}''.",                                 new Object[] { propName, fromValue, workingValue }));                    } else if (workingValue.equals(toValue)) {                        result = result != SVNStatusType.CONFLICTED && isNormal ? SVNStatusType.MERGED : result;                    } else {                        result = isNormal ? SVNStatusType.CONFLICTED : result;                        conflicts.add(MessageFormat.format("Trying to change property ''{0}'' from ''{1}'' to ''{2}'',\n" +                                "but property already exists with value ''{3}''.", new Object[] { propName, fromValue, toValue, workingValue }));                    }                }            }        }        Map command = new HashMap();        if (dryRun) {            return result;        }        log = log == null ? getLog() : log;        saveVersionedProperties(log, true);                if (!conflicts.isEmpty()) {            String prejTmpPath = getThisDirName().equals(name) ? "tmp/dir_conflicts" : "tmp/props/" + name;            File prejTmpFile = SVNFileUtil.createUniqueFile(getAdminDirectory(),  prejTmpPath, ".prej");                        prejTmpPath = SVNFileUtil.getBasePath(prejTmpFile);                        SVNEntry entry = getEntry(name, false);            if (entry == null) {                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND, "Can''t find entry ''{0}'' in ''{1}''", new Object[]{name, getRoot()});                SVNErrorManager.error(err);            }            String prejPath = entry.getPropRejectFile();            closeEntries();            if (prejPath == null) {                prejPath = getThisDirName().equals(name) ? "dir_conflicts" : name;                File prejFile = SVNFileUtil.createUniqueFile(getRoot(), prejPath, ".prej");                prejPath = SVNFileUtil.getBasePath(prejFile);            }            File file = getFile(prejTmpPath);            OutputStream os = SVNFileUtil.openFileForWriting(file);            try {                for (Iterator lines = conflicts.iterator(); lines.hasNext();) {                    String line = (String) lines.next();                    os.write(SVNEncodingUtil.fuzzyEscape(line).getBytes("UTF-8"));//                    os.write(line.getBytes("UTF-8"));                }            } catch (IOException e) {                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot write properties conflict file: {1}", e.getLocalizedMessage());                SVNErrorManager.error(err, e);            } finally {                SVNFileUtil.closeFile(os);            }            command.put(SVNLog.NAME_ATTR, prejTmpPath);            command.put(SVNLog.DEST_ATTR, prejPath);            log.addCommand(SVNLog.APPEND, command, false);            command.clear();            command.put(SVNLog.NAME_ATTR, prejTmpPath);            log.addCommand(SVNLog.DELETE, command, false);            command.clear();            command.put(SVNLog.NAME_ATTR, name);            command.put(SVNProperty.shortPropertyName(SVNProperty.PROP_REJECT_FILE),                        prejPath);            log.addCommand(SVNLog.MODIFY_ENTRY, command, false);        }        return result;    }