public static boolean checkAncestryOfPegPath(String fsPath, long pegRev, long futureRev, FSFS owner) throws SVNException {
FSRevisionRoot root = owner.createRevisionRoot(futureRev);
FSNodeHistory history = getNodeHistory(root, fsPath);
fsPath = null;
SVNLocationEntry currentHistory = null;
while (true) {
history = history.fsHistoryPrev(true, owner);
if (history == null) {
break;
}
currentHistory = new SVNLocationEntry(history.getHistoryEntry().getRevision(), history.getHistoryEntry().getPath());
if (fsPath == null) {
fsPath = currentHistory.getPath();
}
if (currentHistory.getRevision() <= pegRev) {
break;
}
}
if (fsPath == null) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "FATAL error occurred while checking ancestry of peg path");
SVNErrorManager.error(err);
}
return (history != null && (fsPath.equals(currentHistory.getPath())));
}