try { SVNFileUtil.copy(working.getFile(), workingTmp.getFile(), false); SVNFileUtil.copy(base.getFile(), baseTmp.getFile(), false); } catch (IOException e) { SVNErrorManager.error(0, e); }
working.copyTo(workingTmp); base.copyTo(baseTmp);
    public SVNEventStatus mergeProperties(String name, Map changedProperties, Map locallyChanged, SVNLog log) throws SVNException {        if (changedProperties == null || changedProperties.isEmpty()) {            return SVNEventStatus.UNCHANGED;        }        SVNProperties working = getProperties(name, false);        SVNProperties workingTmp = getProperties(name, true);        SVNProperties base = getBaseProperties(name, false);        SVNProperties baseTmp = getBaseProperties(name, true);        try {            SVNFileUtil.copy(working.getFile(), workingTmp.getFile(), false);            SVNFileUtil.copy(base.getFile(), baseTmp.getFile(), false);        } catch (IOException e) {            SVNErrorManager.error(0, e);        }                Collection conflicts = new ArrayList();        SVNEventStatus result = SVNEventStatus.CHANGED;        for (Iterator propNames = changedProperties.keySet().iterator(); propNames.hasNext();) {            String propName = (String) propNames.next();            String propValue = (String) changedProperties.get(propName);            baseTmp.setPropertyValue(propName, propValue);                        if (locallyChanged.containsKey(propName)) {                String workingValue = (String) locallyChanged.get(propName);                String conflict = null;                if (workingValue != null) {                    if (workingValue == null && propValue != null) {                        conflict = MessageFormat.format("Property ''{0}'' locally deleted, but update sets it to ''{1}''\n",                                 new String[] {propName, workingValue});                                            } else if (workingValue != null && propValue == null) {                        conflict = MessageFormat.format("Property ''{0}'' locally changed to ''{1}'', but update deletes it\n",                                 new String[] {propName, workingValue});                                            } else if (workingValue != null && !workingValue.equals(propValue)) {                        conflict = MessageFormat.format("Property ''{0}'' locally changed to ''{1}'', but update sets it to ''{2}''\n",                                 new String[] {propName, workingValue, propValue});                                            }                    if (conflict != null) {                                  conflicts.add(conflict);                        continue;                    }                    result = SVNEventStatus.MERGED;                }            }            workingTmp.setPropertyValue(propName, propValue);        }                // now log all.        Map command = new HashMap();        command.put(SVNLog.NAME_ATTR, workingTmp.getPath());        command.put(SVNLog.DEST_ATTR, working.getPath());        log.addCommand(SVNLog.MOVE, command, false);        command.clear();        command.put(SVNLog.NAME_ATTR, working.getPath());        log.addCommand(SVNLog.READONLY, command, false);        command.put(SVNLog.NAME_ATTR, baseTmp.getPath());        command.put(SVNLog.DEST_ATTR, base.getPath());        log.addCommand(SVNLog.MOVE, command, false);        command.clear();        command.put(SVNLog.NAME_ATTR, base.getPath());        log.addCommand(SVNLog.READONLY, command, false);        if (!conflicts.isEmpty()) {            result = SVNEventStatus.CONFLICTED;            String prejTmpPath = "".equals(name) ? ".svn/tmp/dir-conflicts" : ".svn/tmp/props/" + name;            File prejTmpFile = SVNFileUtil.createUniqueFile(getRoot(), prejTmpPath, ".prej");            prejTmpPath = SVNFileUtil.getBasePath(prejTmpFile);                            String prejPath = getEntries().getEntry(name).getPropRejectFile();            getEntries().close();            if (prejPath == null) {                prejPath = "".equals(name) ? "dir-conflicts" : name;                File prejFile = SVNFileUtil.createUniqueFile(getRoot(), prejPath, ".prej");                prejPath = SVNFileUtil.getBasePath(prejFile);            }            OutputStream os = null;            try {                os = new FileOutputStream(new File(getRoot(), prejTmpPath));                for (Iterator lines = conflicts.iterator(); lines.hasNext();) {                    String line = (String) lines.next();                    os.write(line.getBytes("UTF-8"));                }            } catch (IOException e) {                SVNErrorManager.error(0, e);            } finally {                if (os != null) {                    try {                        os.close();                    } catch (IOException e) {                    }                }            }            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;    }