it does not assume you want to revert the parent of the first sha when reverting 2 shas

This commit is contained in:
rick
2010-12-09 17:21:09 -08:00
parent 979d89a23f
commit 8769e3475b
2 changed files with 2 additions and 7 deletions
+1 -6
View File
@@ -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