Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -109,9 +109,14 @@ |
110 | 110 | $undorev_text = $undorev->getText(); |
111 | 111 | $oldrev_text = $oldrev->getText(); |
112 | 112 | $currev_text = $text; |
| 113 | + |
| 114 | + #No use doing a merge if it's just a straight revert. |
| 115 | + if ($currev_text != $undorev_text) { |
| 116 | + $result = wfMerge($undorev_text, $oldrev_text, $currev_text, $text); |
| 117 | + } else { |
| 118 | + $result = true; |
| 119 | + } |
113 | 120 | |
114 | | - $result = wfMerge($undorev_text, $oldrev_text, $currev_text, $text); |
115 | | - |
116 | 121 | if (!$result) { |
117 | 122 | #Undoing failed. Bailing out with regular revision text. |
118 | 123 | $text = $currev_text; |
Index: trunk/phase3/includes/DifferenceEngine.php |
— | — | @@ -523,9 +523,11 @@ |
524 | 524 | $newLink = $this->mNewPage->escapeLocalUrl(); |
525 | 525 | $this->mPagetitle = htmlspecialchars( wfMsg( 'currentrev' ) ); |
526 | 526 | $newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit' ); |
| 527 | + $newUndo = $this->mNewPage->escapeLocalUrl( 'action=edit&undo=' . $this->mNewid ); |
527 | 528 | |
528 | 529 | $this->mNewtitle = "<a href='$newLink'>{$this->mPagetitle}</a> ($timestamp)" |
529 | | - . " (<a href='$newEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</a>)"; |
| 530 | + . " (<a href='$newEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</a>)" |
| 531 | + . " (<a href='$newUndo'>" . htmlspecialchars( wfMsg( 'editundo' ) ) . "</a>)"; |
530 | 532 | |
531 | 533 | } else { |
532 | 534 | $newLink = $this->mNewPage->escapeLocalUrl( 'oldid=' . $this->mNewid ); |