if (admLockLevel >= 0) {
admLockLevel++;
}
wcAccess.probeOpen(path.getParentFile(), true, admLockLevel);
}
ISVNEntryHandler resolveEntryHandler = new ISVNEntryHandler() {
public void handleEntry(File path, SVNEntry entry) throws SVNException {
if (entry != null && entry.isDirectory() && !"".equals(entry.getName())) {
return;
}
SVNNodeKind kind = SVNNodeKind.UNKNOWN;
long revision = -1;
boolean wcRoot = false;
boolean resolved = false;
if (entry != null && entry.isDirectory()) {
wcRoot = wcAccess.isWCRoot(path);
}
if (resolveTree && !wcRoot) {
File parentDir = path.getParentFile();
SVNAdminArea parentArea = wcAccess.probeRetrieve(parentDir);
SVNTreeConflictDescription tc = parentArea.getTreeConflict(path.getName());
if (tc != null) {
if (choice != SVNConflictChoice.MERGED) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_CONFLICT_RESOLVER_FAILURE,
"Tree conflicts can only be resolved to ''working'' state; ''{0}'' not resolved", path);
SVNErrorManager.error(err, SVNLogType.WC);
}
parentArea.deleteTreeConflict(path.getName());
kind = tc.getNodeKind();
resolved = true;
}
}
if (entry != null && (resolveContents || resolveProperties)) {
kind = entry.getKind();
revision = entry.getRevision();
File conflictDir = entry.isDirectory() ? path : path.getParentFile();
SVNAdminArea conflictArea = wcAccess.retrieve(conflictDir);
resolved |= conflictArea.markResolved(entry.getName(), resolveContents, resolveProperties, choice);
}
if (resolved) {
SVNEvent event = SVNEventFactory.createSVNEvent(path, kind, null,
revision, SVNEventAction.RESOLVED, null, null, null);
dispatchEvent(event);
}
}
public void handleError(File path, SVNErrorMessage error) throws SVNException {
SVNErrorManager.error(error, SVNLogType.WC);
}
};
if (depth == SVNDepth.EMPTY) {
SVNEntry entry = wcAccess.getEntry(path, false);
if (entry != null) {
resolveEntryHandler.handleEntry(path, entry);
} else {
SVNTreeConflictDescription tc = wcAccess.getTreeConflict(path);
if (tc != null) {
resolveEntryHandler.handleEntry(path, null);
} else {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND,
"''{0}'' is not under version control", path);
SVNErrorManager.error(err, SVNLogType.WC);
}