Cancel the edition of an existing page.

    Then render the last modification status

    .. note:: this is a bottle view

    if no page name is given, do nothing (it may leave some .tmp. files in
    the directory).

    Keyword Arguments:
        :name: (str) -- name of the page (OPTIONAL)

    Returns:
        bottle response object

def view_cancel_edit(name=None):
    """Cancel the edition of an existing page.

    Then render the last modification status

    .. note:: this is a bottle view

    if no page name is given, do nothing (it may leave some .tmp. files in
    the directory).

    Keyword Arguments:
        :name: (str) -- name of the page (OPTIONAL)

    Returns:
        bottle response object
    """
    if name is None:
        return redirect('/')
    else:
        files = glob.glob("{0}.rst".format(name))
        if len(files) > 0:
            reset_to_last_commit()
            return redirect('/' + name)
        else:
            return abort(404)