def rollbackToRevision(revision, activate=True):
    """Rollback to the given revision making it the newest one.

        Properly roll back to a previous revision.

        1. The revision must exist in the revision history. Otherwise a
           `KeyError` is raised.

        2. Find all revisions with a start timestamp greater than the
           revision's start timestamp.

           If no revisions are found, the revision is already the latest one.

           Remove all found revisions.

        3. If the `activate` flag is set, then set the revision's end
           timestamp should be set to None.
        """
