SVNDebugLog.getDefaultLog().info("updating revision of an added file(" + dstEntry + "): " + (dstEntry != null ? dstEntry.getRevision() : parentEntry.getRevision()));
    public static void addRepositoryFile(SVNAdminArea dir, String fileName, File text, File textBase, Map baseProperties, Map properties, String copyFromURL, long copyFromRev) throws SVNException {        SVNEntry parentEntry = dir.getEntry(dir.getThisDirName(), false);        if (parentEntry == null) {            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNVERSIONED_RESOURCE, "''{0}'' is not under version control", dir.getRoot());            SVNErrorManager.error(err);        }        String newURL = SVNPathUtil.append(parentEntry.getURL(), SVNEncodingUtil.uriEncode(fileName));        if (copyFromURL != null && parentEntry.getRepositoryRoot() != null && !SVNPathUtil.isAncestor(parentEntry.getRepositoryRoot(), copyFromURL)) {            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Copyfrom-url ''{0}'' has different repository root than ''{1}''", new Object[]{copyFromURL, parentEntry.getRepositoryRoot()});            SVNErrorManager.error(err);        }            SVNEntry dstEntry = dir.getEntry(fileName, false);        SVNLog log = dir.getLog();        Map command = new HashMap();        if (dstEntry != null && dstEntry.isScheduledForDeletion()) {            String revertTextPath = SVNAdminUtil.getTextRevertPath(fileName, false);            String baseTextPath = SVNAdminUtil.getTextBasePath(fileName, false);            String revertPropsPath = SVNAdminUtil.getPropRevertPath(fileName, SVNNodeKind.FILE, false);            String basePropsPath = SVNAdminUtil.getPropBasePath(fileName, SVNNodeKind.FILE, false);                command.put(SVNLog.NAME_ATTR, baseTextPath);            command.put(SVNLog.DEST_ATTR, revertTextPath);            log.addCommand(SVNLog.MOVE, command, false);            command.clear();                        if (dir.getFile(basePropsPath).isFile()) {                command.put(SVNLog.NAME_ATTR, basePropsPath);                command.put(SVNLog.DEST_ATTR, revertPropsPath);                log.addCommand(SVNLog.MOVE, command, false);                command.clear();            }        }                Map entryAttrs = new HashMap();        entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.SCHEDULE), SVNProperty.SCHEDULE_ADD);        if (copyFromURL != null) {            entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.COPIED), SVNProperty.toString(true));            entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.COPYFROM_URL), copyFromURL);            entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.COPYFROM_REVISION), SVNProperty.toString(copyFromRev));        }        log.logChangedEntryProperties(fileName, entryAttrs);        entryAttrs.clear();                entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.KIND), SVNProperty.KIND_FILE);        SVNDebugLog.getDefaultLog().info("updating revision of an added file(" + dstEntry + "): " + (dstEntry != null ? dstEntry.getRevision() : parentEntry.getRevision()));        entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.REVISION), SVNProperty.toString(dstEntry != null ? dstEntry.getRevision() : parentEntry.getRevision()));        entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.URL), newURL);        entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.ABSENT), null);        entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.DELETED), null);        log.logChangedEntryProperties(fileName, entryAttrs);        entryAttrs.clear();            SVNWCManager.addProperties(dir, fileName, baseProperties, true, log);        SVNWCManager.addProperties(dir, fileName, properties, false, log);                File tmpTextBase = dir.getBaseFile(fileName, true);        if (!tmpTextBase.equals(textBase) && textBase != null) {            SVNFileUtil.rename(textBase, tmpTextBase);        }        if (text != null) {            File tmpFile = SVNFileUtil.createUniqueFile(dir.getRoot(), fileName, ".tmp");            SVNFileUtil.rename(text, tmpFile);            if (baseProperties != null && baseProperties.containsKey(SVNProperty.SPECIAL)) {                command.put(SVNLog.NAME_ATTR, tmpFile.getName());                command.put(SVNLog.DEST_ATTR, fileName);                command.put(SVNLog.ATTR1, "true");                log.addCommand(SVNLog.COPY, command, false);                command.clear();                command.put(SVNLog.NAME_ATTR, tmpFile.getName());                log.addCommand(SVNLog.DELETE, command, false);                command.clear();            } else {                command.put(SVNLog.NAME_ATTR, tmpFile.getName());                command.put(SVNLog.DEST_ATTR, fileName);                log.addCommand(SVNLog.MOVE, command, false);                command.clear();            }        } else {            command.put(SVNLog.NAME_ATTR, SVNAdminUtil.getTextBasePath(fileName, true));            command.put(SVNLog.DEST_ATTR, fileName);            log.addCommand(SVNLog.COPY_AND_TRANSLATE, command, false);            command.clear();            command.put(SVNProperty.shortPropertyName(SVNProperty.TEXT_TIME), SVNLog.WC_TIMESTAMP);            log.logChangedEntryProperties(fileName, command);            command.clear();        }                        command.put(SVNLog.NAME_ATTR, SVNAdminUtil.getTextBasePath(fileName, true));        command.put(SVNLog.DEST_ATTR, SVNAdminUtil.getTextBasePath(fileName, false));        log.addCommand(SVNLog.MOVE, command, false);        command.clear();                command.put(SVNLog.NAME_ATTR, SVNAdminUtil.getTextBasePath(fileName, false));        log.addCommand(SVNLog.READONLY, command, false);        command.clear();            String checksum = SVNFileUtil.computeChecksum(dir.getBaseFile(fileName, true));        entryAttrs.put(SVNProperty.shortPropertyName(SVNProperty.CHECKSUM), checksum);        log.logChangedEntryProperties(fileName, entryAttrs);        entryAttrs.clear();                log.save();        dir.runLogs();    }