'Given a dict of changes to make, build and save a new Revision to
revise this document'

def revise(self, user, data, section_id=None):

    curr_rev = self.current_revision
    new_rev = Revision(creator=user, document=self, content=self.html)
    for n in ('title', 'slug', 'render_max_age'):
        setattr(new_rev, n, getattr(self, n))
    if curr_rev:
        new_rev.toc_depth = curr_rev.toc_depth
        original_doc = curr_rev.document.original
        if (original_doc == self):
            new_rev.based_on = curr_rev
        else:
            new_rev.based_on = original_doc.current_revision
    new_title = data.get('title', False)
    new_rev.title = ((new_title and new_title) or self.title)
    new_tags = data.get('tags', False)
    new_rev.tags = ((new_tags and new_tags) or edit_string_for_tags(self.tags.all()))
    new_review_tags = data.get('review_tags', False)
    if new_review_tags:
        review_tags = new_review_tags
    elif curr_rev:
        review_tags = edit_string_for_tags(curr_rev.review_tags.all())
    else:
        review_tags = ''
    new_rev.summary = data.get('summary', '')
    new_rev.comment = data.get('comment', '')
    new_html = data.get('content', data.get('html', False))
    if new_html:
        if (not section_id):
            new_rev.content = new_html
        else:
            content = parse_content(self.html)
            new_rev.content = content.replaceSection(section_id, new_html).serialize()
    new_rev.save()
    new_rev.review_tags.set(*parse_tags(review_tags))
    return new_rev
