Update the wiki.rb update_page functionallity
In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16313 we allow the user to move a page from one directory to another. Right now, the only functionality allowed to the user was to rename the page or move the page inside the same subtree.
Basically, the new implementation that we have added in the rugged version (gollum_update_page
) is:
committer = Gollum::Committer.new(page.wiki, commit_details.to_h)
gollum_wiki.update_page(page, page.name, format, content, committer: committer)
gollum_wiki.rename_page(page, title, committer: committer)
committer.commit
This chunk of code instantiates a new committer shared among the methods to perform the operations in one commit.
But we added some monkey patches because the rugged lib should improve a couple of things. We have submitted a PR to the gollum-lib
to merge the changes. These monkeys patches can be found in the gollum
initializer and basically are: update_page
, rename_page
and raw_data_in_commiter
.