void TurnSnapshotIntoBaselinePrivate(VolumeSnapshotDirectory parentDir, ref List <VolumeSnapshotRevision> revisionsThatCanBeRemoved) { VolumeSnapshotRevision currentRevision = parentDir.Snapshot.Revision; foreach (VolumeSnapshotFile file in parentDir.Files) { if (file.Revision.Value < currentRevision.Value) { revisionsThatCanBeRemoved.Add(file.Revision); // file is older than current snapshot, copy it into the current snapshot // Use Move for speed - the file will be deleted in the next step anyway and // will no longer be needed mArchive.MoveFileFromRevision(file.Revision, currentRevision, file.RelativePath); // update revision id in .xml file file.Revision = currentRevision; } } foreach (VolumeSnapshotDirectory dir in parentDir.Directories) { if (dir.Revision.Value < currentRevision.Value) { dir.Revision = currentRevision; } TurnSnapshotIntoBaselinePrivate(dir, ref revisionsThatCanBeRemoved); } }