}
toRestore.put(historyId, v);
}
WriteOperation ops = startWriteOperation();
try {
internalRestore(new VersionSet(toRestore, true), removeExisting);
ops.save();
} catch (ItemStateException e) {
throw new RepositoryException(e);
} finally {
ops.close();