} else {
locks = new SVNLock[0];
}
locks = locks == null ? new SVNLock[0] : locks;
Map locksMap = new SVNHashMap();
for (int i = 0; i < locks.length; i++) {
SVNLock lock = locks[i];
locksMap.put(lock.getPath(), lock);
}
pushDirInfo(repos, SVNRevision.create(revNum[0]), "", repos.getRepositoryRoot(true),
reposUUID, url, locksMap, depth, handler);
return;
}
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE,
"Server does not support retrieving information about the repository root");
SVNErrorManager.error(err, SVNLogType.WC);
}
SVNNodeKind urlKind = repos.checkPath("", revNum[0]);
if (urlKind == SVNNodeKind.NONE) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL,
"URL ''{0}'' non-existent in revision {1}",
new Object[]{ url, new Long(revNum[0]) });
SVNErrorManager.error(err, SVNLogType.WC);
}
SVNRepository parentRepos = createRepository(url.removePathTail(), null, null, false);
Collection dirEntries = parentRepos.getDir("", revNum[0], null, SVNDirEntry.DIRENT_KIND |
SVNDirEntry.DIRENT_CREATED_REVISION | SVNDirEntry.DIRENT_TIME |
SVNDirEntry.DIRENT_LAST_AUTHOR, ( Collection )null);
for (Iterator ents = dirEntries.iterator(); ents.hasNext();) {
SVNDirEntry dirEntry = (SVNDirEntry) ents.next();
// dir entry name may differ from 'name', due to renames...
if (baseName.equals(dirEntry.getName())) {
rootEntry = dirEntry;
break;
}
}
if (rootEntry == null) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL,
"URL ''{0}'' non-existent in revision {1}",
new Object[]{ url, new Long(revNum[0]) });
SVNErrorManager.error(err, SVNLogType.WC);
}
} else {
throw e;
}
}
if (rootEntry == null || rootEntry.getKind() == SVNNodeKind.NONE) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL,
"URL ''{0}'' non-existent in revision ''{1}''",
new Object[]{ url, new Long(revNum[0]) });
SVNErrorManager.error(err, SVNLogType.WC);
}
SVNLock lock = null;
if (rootEntry.getKind() == SVNNodeKind.FILE) {
try {
SVNRepositoryLocation[] locations = getLocations(url, null, null, revision, SVNRevision.HEAD,
SVNRevision.UNDEFINED);
if (locations != null && locations.length > 0) {
SVNURL headURL = locations[0].getURL();
if (headURL.equals(url)) {
// get lock for this item (@headURL).
try {
lock = repos.getLock("");
} catch (SVNException e) {
if (!(e.getErrorMessage() != null &&
e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_NOT_IMPLEMENTED)) {
throw e;
}
}
}
}
} catch (SVNException e) {
SVNErrorCode code = e.getErrorMessage().getErrorCode();
if (code != SVNErrorCode.FS_NOT_FOUND && code != SVNErrorCode.CLIENT_UNRELATED_RESOURCES) {
throw e;
}
}
}
SVNInfo info = SVNInfo.createInfo(baseName, reposRoot, reposUUID, url, SVNRevision.create(revNum[0]),
rootEntry, lock);
handler.handleInfo(info);
if (depth.compareTo(SVNDepth.EMPTY) > 0 && rootEntry.getKind() == SVNNodeKind.DIR) {
SVNLock[] locks = null;
if (pegRevision == SVNRevision.HEAD) {
try {
locks = repos.getLocks("");
} catch (SVNException svne) {
SVNErrorCode code = svne.getErrorMessage().getErrorCode();
if (code == SVNErrorCode.RA_NOT_IMPLEMENTED ||
code == SVNErrorCode.UNSUPPORTED_FEATURE) {
locks = new SVNLock[0];
} else {
throw svne;
}
}
} else {
locks = new SVNLock[0];
}
locks = locks == null ? new SVNLock[0] : locks;
Map locksMap = new SVNHashMap();
for (int i = 0; i < locks.length; i++) {
lock = locks[i];
locksMap.put(lock.getPath(), lock);
}
pushDirInfo(repos, SVNRevision.create(revNum[0]), "", repos.getRepositoryRoot(true),
reposUUID, url, locksMap, depth, handler);
}