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