SVNProperties srcProps = srcAccess.getAnchor().getProperties(srcAccess.getTargetName(), false); boolean executable = srcProps.getPropertyValue(SVNProperty.EXECUTABLE) != null; SVNProperties srcBaseProps = srcAccess.getAnchor().getBaseProperties(srcAccess.getTargetName(), false);
File dstTextBase = dstAccess.getAnchor().getBaseFile(dstName, false); if (srcTextBase.exists()) { SVNFileUtil.copyFile(srcTextBase, dstTextBase, false); }
    private void copyFile(SVNWCAccess dstAccess, SVNWCAccess srcAccess,  String dstName) throws SVNException {        SVNEntry dstEntry = dstAccess.getAnchor().getEntries().getEntry(dstName, false);        File dstPath = new File(dstAccess.getAnchor().getRoot(), dstName);        File srcPath = new File(srcAccess.getAnchor().getRoot(), srcAccess.getTargetName());        if (dstEntry != null && dstEntry.isFile()) {            if (dstEntry.isScheduledForDeletion()) {                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_EXISTS, "''{0}'' is scheduled for deletion; it must be committed before being overwritten", dstPath);                SVNErrorManager.error(err);            } else {                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_EXISTS, "There is already versioned item ''{0}''", dstPath);                SVNErrorManager.error(err);            }        }        SVNEntry srcEntry = srcAccess.getTargetEntry();        if (srcEntry == null) {            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNVERSIONED_RESOURCE, "Cannot copy or move ''{0}'': it's not under version control", srcPath);            SVNErrorManager.error(err);        } else if (srcEntry.isScheduledForAddition() || srcEntry.getURL() == null || srcEntry.isCopied()) {            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Cannot copy or move ''{0}'': it's not in repository yet; try committing first", srcPath);            SVNErrorManager.error(err);        }        SVNFileType srcType = SVNFileType.getType(srcPath);        if (srcType == SVNFileType.SYMLINK) {            String name = SVNFileUtil.getSymlinkName(srcPath);            if (name != null) {                SVNFileUtil.createSymlink(dstPath, name);            }        } else {            SVNFileUtil.copyFile(srcPath, dstPath, false);        }        // copy props, props base and text-base        File srcTextBase = srcAccess.getAnchor().getBaseFile(srcAccess.getTargetName(), false);        SVNProperties srcProps = srcAccess.getAnchor().getProperties(srcAccess.getTargetName(), false);        boolean executable = srcProps.getPropertyValue(SVNProperty.EXECUTABLE) != null;        SVNProperties srcBaseProps = srcAccess.getAnchor().getBaseProperties(srcAccess.getTargetName(), false);        File dstTextBase = dstAccess.getAnchor().getBaseFile(dstName, false);        SVNProperties dstProps = dstAccess.getAnchor().getProperties(dstName, false);        SVNProperties dstBaseProps = srcAccess.getAnchor().getBaseProperties(dstName, false);        if (srcTextBase.exists()) {            SVNFileUtil.copyFile(srcTextBase, dstTextBase, false);        }        if (srcProps.getFile().exists()) {            srcProps.copyTo(dstProps);        }        if (srcBaseProps.getFile().exists()) {            srcBaseProps.copyTo(dstBaseProps);        }        if (executable) {            SVNFileUtil.setExecutable(dstPath, true);        }        // and finally -> add.        String copyFromURL = srcEntry.getURL();        long copyFromRevision = srcEntry.getRevision();        SVNEntry entry = dstAccess.getAnchor().add(dstName, false, false);        entry.setCopied(true);        entry.setCopyFromRevision(copyFromRevision);        entry.setCopyFromURL(copyFromURL);        entry.setRevision(copyFromRevision);        entry.scheduleForAddition();        dstAccess.getAnchor().getEntries().save(true);    }