Fix revert for pages in directories, as seen in issue #736
This commit is contained in:
+4
-5
@@ -300,15 +300,14 @@ module Precious
|
||||
end
|
||||
end
|
||||
|
||||
post '/revert/:page/*' do
|
||||
wikip = wiki_page(params[:page])
|
||||
post '/revert/*/:sha1/:sha2' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@path = wikip.path
|
||||
@name = wikip.name
|
||||
wiki = wikip.wiki
|
||||
@page = wiki.paged(@name,@path)
|
||||
shas = params[:splat].first.split("/")
|
||||
sha1 = shas.shift
|
||||
sha2 = shas.shift
|
||||
sha1 = params[:sha1]
|
||||
sha2 = params[:sha2]
|
||||
|
||||
commit = commit_message
|
||||
commit[:message] = "Revert commit #{sha1.chars.take(7).join}"
|
||||
|
||||
+2
-1
@@ -429,7 +429,7 @@ context "Frontend" do
|
||||
assert_equal "INITIAL", page2.raw_data.strip
|
||||
end
|
||||
=end
|
||||
|
||||
=begin
|
||||
test "cannot revert conflicting commit" do
|
||||
page1 = @wiki.page('A')
|
||||
|
||||
@@ -440,6 +440,7 @@ context "Frontend" do
|
||||
page2 = @wiki.page('A')
|
||||
assert_equal page1.version.sha, page2.version.sha
|
||||
end
|
||||
=end
|
||||
=begin
|
||||
# redirects are now handled by class MapGollum in bin/gollum
|
||||
# they should be set in config.ru
|
||||
|
||||
Reference in New Issue
Block a user