it does not assume you want to revert the parent of the first sha when reverting 2 shas
This commit is contained in:
@@ -89,16 +89,11 @@ module Precious
|
||||
shas = params[:splat].first.split("/")
|
||||
sha1 = shas.shift
|
||||
sha2 = shas.shift
|
||||
sha1 = "#{sha1}^" if sha2
|
||||
|
||||
if wiki.revert_page(@page, sha1, sha2, commit_message)
|
||||
redirect "/#{CGI.escape(@name)}"
|
||||
else
|
||||
if sha2
|
||||
sha1.chomp!('^')
|
||||
else
|
||||
sha2, sha1 = sha1, "#{sha1}^"
|
||||
end
|
||||
sha2, sha1 = sha1, "#{sha1}^" if !sha2
|
||||
@versions = [sha1, sha2]
|
||||
diffs = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
@diff = diffs.first
|
||||
|
||||
Reference in New Issue
Block a user