From: umherirrender Date: Wed, 10 Jul 2013 19:49:36 +0000 (+0200) Subject: diff: Display "(No difference)" instead of an empty diff X-Git-Tag: 1.31.0-rc.0~19176^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=2bdb4895f9eeed1dc928caed7c94db7b0455e813;p=lhc%2Fweb%2Fwiklou.git diff: Display "(No difference)" instead of an empty diff This makes it easier to see the fact, because without a hint, the user can mean, that there is something missing, but here the missing is okay and for that, the message is helpful. Change-Id: I458fb688b0001fb674ece65b3fdabf56fc658a29 --- diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 5e93c0f315..86b0c2b122 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -147,6 +147,8 @@ production. * Added a new method and hook, User::isEveryoneAllowed() and UserIsEveryoneAllowed, for use in situations where a "does everyone have this right?" check is used to avoid more expensive checks. +* Display "(No difference)" instead of an empty diff (when comparing revisions + in the history or when previewing changes while editing). === Bug fixes in 1.22 === * Disable Special:PasswordReset when $wgEnableEmail is false. Previously one diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 4c2de4e2c9..665766775d 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -610,6 +610,13 @@ class DifferenceEngine extends ContextSource { return false; } else { $multi = $this->getMultiNotice(); + // Display a message when the diff is empty + if ( $body === '' ) { + if ( $multi !== '' ) { + $multi .= '
'; + } + $multi .= $this->msg( 'diff-empty' )->parse(); + } return $this->addHeader( $body, $otitle, $ntitle, $multi, $notice ); } } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e3af968774..9e98cc443a 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1779,6 +1779,7 @@ Note that using the navigation links will reset this column.', 'compareselectedversions' => 'Compare selected revisions', 'showhideselectedversions' => 'Show/hide selected revisions', 'editundo' => 'undo', +'diff-empty' => '(No difference)', 'diff-multi' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} by {{PLURAL:$2|one user|$2 users}} not shown)', 'diff-multi-manyusers' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} by more than $2 {{PLURAL:$2|user|users}} not shown)', 'difference-missing-revision' => '{{PLURAL:$2|One revision|$2 revisions}} of this difference ($1) {{PLURAL:$2|was|were}} not found. diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 1a1b466ff9..fbe715a344 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -2305,6 +2305,7 @@ See also: This message has sometimes a tooltip {{msg-mw|tooltip-undo}} {{Identical|Undo}}', +'diff-empty' => 'This message appears instead of a "diff" when comparing two revisions that are identical.', 'diff-multi' => "This message appears in the revision history of a page when comparing two versions which aren't consecutive. *Parameter $1 is the number of revisions diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 49ed8800ab..36abe6695f 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -930,6 +930,7 @@ $wgMessageStructure = array( 'compareselectedversions', 'showhideselectedversions', 'editundo', + 'diff-empty', 'diff-multi', 'diff-multi-manyusers', 'difference-missing-revision',