view MoinMoin/action/revert.py @ 2853:40e50e27ee50

test_text_html_text_moin_wiki: tests fixed
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 20 Sep 2007 20:56:41 +0200
parents 0a6f74a01646
children ba14d391c2ba
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - revert a page to a previous revision

    @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
                2006 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
"""
from MoinMoin.Page import Page

def execute(pagename, request):
    """ restore another revision of a page as a new current revision """
    from MoinMoin.PageEditor import PageEditor
    rev = request.rev
    pg = PageEditor(request, pagename)

    try:
        msg = pg.revertPage(rev)
    except PageEditor.RevertError, error:
        msg = unicode(error)

    request.reset()
    pg.send_page(msg=msg)