path = MongoUtil.adjustPath(path);
checkDepth();
long fromRevisionId, toRevisionId;
if (fromRevision == null || toRevision == null) {
long head = new FetchHeadRevisionIdAction(nodeStore).execute();
fromRevisionId = fromRevision == null? head : MongoUtil.toMongoRepresentation(fromRevision);
toRevisionId = toRevision == null ? head : MongoUtil.toMongoRepresentation(toRevision);;
} else {
fromRevisionId = MongoUtil.toMongoRepresentation(fromRevision);
toRevisionId = MongoUtil.toMongoRepresentation(toRevision);;