text: public IndexRevision(IndexWriter writer) throws IOException {IndexDeletionPolicy delPolicy = writer.getConfig().getIndexDeletionPolicy();if (!(delPolicy instanceof SnapshotDeletionPolicy)) {throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");}this.writer = writer;this.sdp = (SnapshotDeletionPolicy) delPolicy;this.commit = sdp.snapshot();this.version = revisionVersion(commit);this.sourceFiles = revisionFiles(commit);}