public VersionHistoryInfo getVersionHistory(Session session, NodeState node,
NodeId copiedFrom)
throws RepositoryException {
VersionHistoryInfo info = null;
ReadLock lock = acquireReadLock();
try {
String uuid = node.getNodeId().getUUID().toString();
Name name = getName(uuid);
NodeStateEx parent = getParentNode(historyRoot, uuid, null);
if (parent != null && parent.hasNode(name)) {
NodeStateEx history = parent.getNode(name, 1);
Name root = NameConstants.JCR_ROOTVERSION;
info = new VersionHistoryInfo(
history.getNodeId(),
history.getState().getChildNodeEntry(root, 1).getId());
}
} finally {
lock.release();
}
if (info == null) {
info = createVersionHistory(session, node, copiedFrom);
}