SVNDepth depth, boolean getAll, boolean noIgnore, Collection ignorePatterns, boolean skipThisDir,
ISVNStatusHandler handler) throws SVNException {
myWCAccess.checkCancelled();
depth = depth == SVNDepth.UNKNOWN ? SVNDepth.INFINITY : depth;
Map childrenFiles = getChildrenFiles(dir.getRoot());
SVNEntry dirEntry = myWCAccess.getEntry(dir.getRoot(), false);
String externals = dir.getProperties(dir.getThisDirName()).getStringPropertyValue(SVNProperty.EXTERNALS);
if (externals != null) {
String path = dir.getRelativePath(myAdminInfo.getAnchor());
myAdminInfo.addExternal(path, externals, externals);
myAdminInfo.addDepth(path, dirEntry.getDepth());
SVNExternal[] externalsInfo = SVNExternal.parseExternals(dir.getRelativePath(myAdminInfo.getAnchor()), externals);
for (int i = 0; i < externalsInfo.length; i++) {
SVNExternal external = externalsInfo[i];
myExternalsMap.put(SVNPathUtil.append(path, external.getPath()), external);
}
}
if (entryName != null) {
File file = (File) childrenFiles.get(entryName);
SVNEntry entry = dir.getEntry(entryName, false);
if (entry != null) {
SVNFileType fileType = SVNFileType.getType(file);
boolean special = fileType == SVNFileType.SYMLINK;
SVNNodeKind fileKind = SVNFileType.getNodeKind(fileType);
handleDirEntry(dir, entryName, dirEntry, entry,
fileKind, special, depth, getAll, noIgnore, handler);
} else if (file != null) {
if (ignorePatterns == null) {
ignorePatterns = getIgnorePatterns(dir, myGlobalIgnores);
}
SVNFileType fileType = SVNFileType.getType(file);
boolean special = fileType == SVNFileType.SYMLINK;
SVNNodeKind fileKind = SVNFileType.getNodeKind(fileType);
sendUnversionedStatus(file, entryName, fileKind, special, dir, ignorePatterns, noIgnore, handler);
} else {
SVNTreeConflictDescription treeConflict = myWCAccess.getTreeConflict(dir.getFile(entryName));
if (treeConflict != null) {
if (ignorePatterns == null) {
ignorePatterns = getIgnorePatterns(dir, myGlobalIgnores);
}
sendUnversionedStatus(dir.getFile(entryName), entryName, SVNNodeKind.NONE, false, dir, ignorePatterns, true, handler);
}
}
return;
}
if (!skipThisDir) {
SVNStatus status = assembleStatus(dir.getRoot(), dir, dirEntry, parentEntry,
SVNNodeKind.DIR, false, isReportAll(), false);
if (status != null && handler != null) {
handler.handleStatus(status);
}
}
if (depth == SVNDepth.EMPTY) {
return;
}
// iterate over files.
childrenFiles = new TreeMap(childrenFiles);
for (Iterator files = childrenFiles.keySet().iterator(); files.hasNext();) {
String fileName = (String) files.next();
if (dir.getEntry(fileName, false) != null || SVNFileUtil.getAdminDirectoryName().equals(fileName)) {
continue;
}
File file = (File) childrenFiles.get(fileName);
if (depth == SVNDepth.FILES && file.isDirectory()) {
continue;
}
if (ignorePatterns == null) {
ignorePatterns = getIgnorePatterns(dir, myGlobalIgnores);
}
sendUnversionedStatus(file, fileName, SVNNodeKind.NONE, false, dir, ignorePatterns, noIgnore,
handler);
}
Map treeConflicts = SVNTreeConflictUtil.readTreeConflicts(dir.getRoot(), dirEntry.getTreeConflictData());
for (Iterator treeConflictsIter = treeConflicts.keySet().iterator(); treeConflictsIter.hasNext();) {
File conflictPath = (File) treeConflictsIter.next();
if (childrenFiles.containsKey(conflictPath.getName()) || dir.getEntry(conflictPath.getName(), false) != null) {
continue;
}
if (ignorePatterns == null) {
ignorePatterns = getIgnorePatterns(dir, myGlobalIgnores);
}
sendUnversionedStatus(conflictPath, conflictPath.getName(), SVNNodeKind.NONE, false, dir, ignorePatterns, noIgnore,
handler);
}
for(Iterator entries = dir.entries(false); entries.hasNext();) {
SVNEntry entry = (SVNEntry) entries.next();
if (dir.getThisDirName().equals(entry.getName())) {
continue;
}
if (depth == SVNDepth.FILES && entry.isDirectory()) {
continue;
}
File file = (File) childrenFiles.get(entry.getName());
SVNFileType fileType = SVNFileType.getType(file);
boolean special = fileType == SVNFileType.SYMLINK;
SVNNodeKind fileKind = SVNFileType.getNodeKind(fileType);
handleDirEntry(dir, entry.getName(), dirEntry, entry,
fileKind, special, depth == SVNDepth.INFINITY ? depth : SVNDepth.EMPTY,
getAll, noIgnore, handler);
}
}