}
FSRevisionRoot root = myFSFS.createRevisionRoot(revision);
FSParentPath parentPath = root.openPath(path, true, true);
FSRevisionNode revNode = parentPath.getRevNode();
SVNLocationEntry commitEntry = new SVNLocationEntry(revNode.getCreatedRevision(),
revNode.getCreatedPath());
FSNodeHistory prevHist = null;
if (revision == commitEntry.getRevision()) {
if (!reported) {
prevHist = new FSNodeHistory(commitEntry, true,
new SVNLocationEntry(SVNRepository.INVALID_REVISION, null),
myFSFS);
return prevHist;
}
FSID predId = revNode.getPredecessorId();
if (predId == null) {
return prevHist;
}
revNode = myFSFS.getRevisionNode(predId);
commitEntry = new SVNLocationEntry(revNode.getCreatedRevision(), revNode.getCreatedPath());
}
SVNLocationEntry copyrootEntry = findYoungestCopyroot(myFSFS.getRepositoryRoot(),
parentPath);
SVNLocationEntry srcEntry = new SVNLocationEntry(SVNRepository.INVALID_REVISION, null);
long dstRev = SVNRepository.INVALID_REVISION;
if (copyrootEntry.getRevision() > commitEntry.getRevision()) {
FSRevisionRoot copyrootRoot = myFSFS.createRevisionRoot(copyrootEntry.getRevision());
revNode = copyrootRoot.getRevisionNode(copyrootEntry.getPath());
String copyDst = revNode.getCreatedPath();
String reminder = null;
if (path.equals(copyDst)) {
reminder = "";
} else {
reminder = SVNPathUtil.getPathAsChild(copyDst, path);
}
if (reminder != null) {
String copySrc = revNode.getCopyFromPath();
srcEntry = new SVNLocationEntry(revNode.getCopyFromRevision(), SVNPathUtil.getAbsolutePath(SVNPathUtil.append(copySrc, reminder)));
dstRev = copyrootEntry.getRevision();
}
}
if (srcEntry.getPath() != null && FSRepository.isValidRevision(srcEntry.getRevision())) {
boolean retry = false;
if ((dstRev == revision) && reported) {
retry = true;
}
return new FSNodeHistory(new SVNLocationEntry(dstRev, path),
retry ? false : true,
new SVNLocationEntry(srcEntry.getRevision(), srcEntry.getPath()),
myFSFS);
}
return new FSNodeHistory(commitEntry, true,
new SVNLocationEntry(SVNRepository.INVALID_REVISION, null),
myFSFS);
}