if (pegRevision == null || !pegRevision.isValid()) {
pegRevision = revision;
}
long[] revNum = { SVNRepository.INVALID_REVISION };
SVNRepository repos = createRepository(url, null, null, pegRevision, revision, revNum);
url = repos.getLocation();
SVNDirEntry rootEntry = null;
SVNURL reposRoot = repos.getRepositoryRoot(true);
String reposUUID = repos.getRepositoryUUID(true);
String baseName = SVNPathUtil.tail(url.getPath());
try {
rootEntry = repos.info("", revNum[0]);
} catch (SVNException e) {
if (e.getErrorMessage() != null &&
e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_NOT_IMPLEMENTED) {
// for svnserve older then 1.2.0
if (url.equals(reposRoot)) {
if (depth.compareTo(SVNDepth.EMPTY) > 0) {
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++) {
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();