}
FSRevisionRoot root = owner.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(FSRepository.SVN_INVALID_REVNUM, null));
return prevHist;
}
FSID predId = revNode.getPredecessorId();
if (predId == null) {
return prevHist;
}
revNode = owner.getRevisionNode(predId);
commitEntry = new SVNLocationEntry(revNode.getCreatedRevision(), revNode.getCreatedPath());
}
SVNLocationEntry copyrootEntry = findYoungestCopyroot(owner.getRepositoryRoot(), parentPath);
SVNLocationEntry srcEntry = new SVNLocationEntry(FSRepository.SVN_INVALID_REVNUM, null);
long dstRev = FSRepository.SVN_INVALID_REVNUM;
if (copyrootEntry.getRevision() > commitEntry.getRevision()) {
FSRevisionRoot copyrootRoot = owner.createRevisionRoot(copyrootEntry.getRevision());
revNode = copyrootRoot.getRevisionNode(copyrootEntry.getPath());
String copyDst = revNode.getCreatedPath();
String reminder = null;
if (path.equals(copyDst)) {
reminder = "";
} else {
reminder = SVNPathUtil.pathIsChild(copyDst, path);
}
if (reminder != null) {
String copySrc = revNode.getCopyFromPath();
srcEntry = new SVNLocationEntry(revNode.getCopyFromRevision(), SVNPathUtil.concatToAbs(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()));
}
return new FSNodeHistory(commitEntry, true, new SVNLocationEntry(FSRepository.SVN_INVALID_REVNUM, null));
}