}
// TODO protocol
SVNFileType fileType = SVNFileType.getType(mergedFile);
if (fileType == SVNFileType.NONE) {
SVNEntry entry = getWCAccess().getEntry(mergedFile, false);
if (entry != null && !entry.isScheduledForDeletion()) {
return SVNStatusType.OBSTRUCTED;
}
if (myIsDryRun) {
myAddedPath = path;
} else {
if (!mergedFile.mkdirs()) {
if (SVNFileType.getType(mergedFile) != SVNFileType.DIRECTORY) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot create directory ''{0}''", mergedFile);
SVNErrorManager.error(err, SVNLogType.DEFAULT);
}
}
ISVNEventHandler oldEventHandler = dir.getWCAccess().getEventHandler();
dir.getWCAccess().setEventHandler(null);
SVNWCManager.add(mergedFile, dir, copyFromURL, copyFromRevision, null);
dir.getWCAccess().setEventHandler(oldEventHandler);
}
return SVNStatusType.CHANGED;
} else if (fileType == SVNFileType.DIRECTORY) {
SVNEntry entry = getWCAccess().getEntry(mergedFile, false);
if (entry == null || entry.isScheduledForDeletion()) {
if (!myIsDryRun) {
ISVNEventHandler oldEventHandler = dir.getWCAccess().getEventHandler();
dir.getWCAccess().setEventHandler(null);
SVNWCManager.add(mergedFile, dir, copyFromURL, copyFromRevision, null);
dir.getWCAccess().setEventHandler(oldEventHandler);
}
if (myIsDryRun) {
myAddedPath = path;
}
return SVNStatusType.CHANGED;
} else if (myIsDryRun && isPathDeleted(path)) {
return SVNStatusType.CHANGED;
}
return SVNStatusType.OBSTRUCTED;
} else if (fileType == SVNFileType.FILE || fileType == SVNFileType.SYMLINK) {
if (myIsDryRun) {
myAddedPath = null;
}
SVNEntry entry = getWCAccess().getEntry(mergedFile, false);
if (entry != null && myIsDryRun && isPathDeleted(path)) {
return SVNStatusType.CHANGED;
}
return SVNStatusType.OBSTRUCTED;
}