'Reverts the given revision by creating a new one.
- Sets its comment to the given value and points the new revision
to the old revision
- Keeps review tags
- Make new revision the current one of the document'

def revert(self, revision, user, comment=None):

    old_revision_pk = revision.pk
    old_review_tags = list(revision.review_tags.names())
    with transaction.atomic():
        revision.pk = None
        revision.comment = ('Revert    to    revision    of    %s    by    %s' % (revision.created, revision.creator))
        if comment:
            revision.comment = (u'%s:    "%s"' % (revision.comment, comment))
        revision.created = datetime.now()
        revision.creator = user
        if (revision.document.original.pk == self.pk):
            revision.based_on_id = old_revision_pk
        revision.save()
        if old_review_tags:
            revision.review_tags.set(*old_review_tags)
    revision.refresh_from_db()
    revision.make_current()
    return revision
