}
}
}
public static void addRepositoryFile(SVNAdminArea dir, String fileName, File text, File textBase, SVNProperties baseProperties, SVNProperties properties, String copyFromURL, long copyFromRev) throws SVNException {
SVNEntry parentEntry = dir.getVersionedEntry(dir.getThisDirName(), false);
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, SVNLogType.WC);
}
SVNEntry dstEntry = dir.getEntry(fileName, false);
SVNLog log = dir.getLog();
SVNProperties command = new SVNProperties();
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();
} else {
String emptyPropPath = SVNAdminUtil.getPropBasePath(fileName, SVNNodeKind.FILE, false);
SVNWCProperties.setProperties(new SVNProperties(), null, dir.getFile(emptyPropPath),
SVNWCProperties.SVN_HASH_TERMINATOR);
command.put(SVNLog.NAME_ATTR, emptyPropPath);
command.put(SVNLog.DEST_ATTR, revertPropsPath);
log.addCommand(SVNLog.MOVE, command, false);
command.clear();
}
}
SVNProperties entryAttrs = new SVNProperties();
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();
log.logTweakEntry(fileName, newURL, dstEntry != null ? dstEntry.getRevision() : parentEntry.getRevision());
SVNWCManager.addProperties(dir, fileName, baseProperties, true, log);
SVNWCManager.addProperties(dir, fileName, properties, false, log);
File tmpTextBase = dir.getBaseFile(fileName, true);