r72866 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72865‎ | r72866 | r72867 >
Date:15:39, 12 September 2010
Author:demon
Status:ok (Comments)
Tags:
Comment:
(bug 24007) Diff pages now mention the number of users having edited intermediate revisions. Also updated MessagesQqq so these are a little more clear
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceInterface.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesQqq.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -804,6 +804,7 @@
805805 'showhideselectedversions',
806806 'editundo',
807807 'diff-multi',
 808+ 'diff-multi-manyusers',
808809 ),
809810 'search' => array(
810811 'search-summary',
Index: trunk/phase3/includes/diff/DifferenceInterface.php
@@ -812,10 +812,24 @@
813813 }
814814
815815 $n = $this->mTitle->countRevisionsBetween( $oldid, $newid );
816 - if ( !$n )
 816+ if ( !$n ) {
817817 return '';
818 -
819 - return wfMsgExt( 'diff-multi', array( 'parseinline' ), $n );
 818+ } else {
 819+ global $wgLang;
 820+ $dbr = wfGetDB( DB_SLAVE );
 821+ $res = $dbr->select( 'revision', 'DISTINCT rev_user_text',
 822+ array(
 823+ 'rev_page = ' . $this->mOldRev->getPage(),
 824+ 'rev_id > ' . $this->mOldRev->getId(),
 825+ 'rev_id < ' . $this->mNewRev->getId()
 826+ ), __METHOD__,
 827+ array( 'LIMIT' => 101 )
 828+ );
 829+ $numUsers = $dbr->numRows( $res );
 830+ $msg = $numUsers > 100 ? 'diff-multi-manyusers' : 'diff-multi';
 831+ return wfMsgExt( $msg, array( 'parseinline' ), $wgLang->formatnum( $n ),
 832+ $wgLang->formatnum( $numUsers ) );
 833+ }
820834 }
821835
822836
Index: trunk/phase3/languages/messages/MessagesQqq.php
@@ -1154,8 +1154,14 @@
11551155 'showhideselectedversions' => 'Text of the button which brings up the [[mw:RevisionDelete|RevisionDelete]] menu.',
11561156 'editundo' => 'Undo link when viewing diffs
11571157 {{Identical|Undo}}',
1158 -'diff-multi' => "This message appears in the revision history of a page when comparing two versions which aren't consecutive.",
 1158+'diff-multi' => "This message appears in the revision history of a page when comparing two versions which aren't consecutive.
11591159
 1160+*Parameter $1 is the number of revisions
 1161+*Parameter $2 is the number of users making those revisions",
 1162+'diff-multi-manyuser' => "This message appears in the revision history of a page when comparing two versions which aren't consecutive, and the intermediate revisions have been edited by 100+ users
 1163+
 1164+*$1 is the number of revisions, will always be 100 or more",
 1165+
11601166 # Search results
11611167 'searchresults-title' => 'Appears as page title in the html header of the search result special page.',
11621168 'notitlematches' => 'Header of results page after a search for a title for which no page exists',
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1617,7 +1617,8 @@
16181618 'compareselectedversions' => 'Compare selected revisions',
16191619 'showhideselectedversions' => 'Show/hide selected revisions',
16201620 'editundo' => 'undo',
1621 -'diff-multi' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} not shown)',
 1621+'diff-multi' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} by {{PLURAL:$2|one user|$2 users}} not shown)',
 1622+'diff-multi-manyusers' => '($1 intermediate revisions intermediate revisions by 100+ users not shown)',
16221623
16231624 # Search results
16241625 'search-summary' => '', # do not translate or duplicate this message to other languages
Index: trunk/phase3/RELEASE-NOTES
@@ -148,6 +148,8 @@
149149 * The parser cache is now shared amongst users whose different settings aren't
150150 used in the page.
151151 * Any attribute beginning with "data-" can now be used in wikitext, per HTML5.
 152+* (bug 24007) Diff pages now mention the number of users having edited
 153+ intermediate revisions
152154
153155 === Bug fixes in 1.17 ===
154156 * (bug 17560) Half-broken deletion moved image files to deletion archive

Follow-up revisions

RevisionCommit summaryAuthorDate
r72877followup r72866, at least remove the double wordsnikerabbit17:36, 12 September 2010
r72897Followup r72866, make 100 in 100+ a param. Makes raising the limit easier :)demon14:21, 13 September 2010
r72911Re-add message descriptions from r72866, accidentally removed in r72882, with...demon15:48, 13 September 2010
r78254Folllowup r72866: use array syntax for rev_page = foo conditioncatrope15:55, 12 December 2010

Comments

#Comment by 😂 (talk | contribs)   15:41, 12 September 2010

Fixed typo in MessagesQqq in r72868.

#Comment by Nikerabbit (talk | contribs)   16:20, 12 September 2010

I'd not put the number itself (100) in the message directly. Also would reword "$1 intermediate revisions by over {{PLURAL:$2|one|$1 users}} not shown)".

#Comment by 😂 (talk | contribs)   13:56, 13 September 2010

Why not? It's a hard limit of 100.

And $2 is useless here, the only possible value is 101.

#Comment by Catrope (talk | contribs)   13:58, 13 September 2010

Some time in the future we might want to change this limit, and it'd be nice not to have to retranslate all those messages in that case.

#Comment by 😂 (talk | contribs)   14:05, 13 September 2010

Fair enough.

#Comment by Reach Out to the Truth (talk | contribs)   17:30, 12 September 2010

"intermediate revisions" appears twice in the diff-multi-manyusers message.

#Comment by Gurch (talk | contribs)   18:15, 12 September 2010

Is this going to have any noticeable impact on load times for diffs? Just that they're kind of slow as it is right now.

#Comment by Aaron Schulz (talk | contribs)   18:38, 12 September 2010

This won't have any noticeable effect (a quick lookup).

The bottleneck is in parsing the page, as well as running diff2 to lessor extent.

#Comment by Platonides (talk | contribs)   19:00, 12 September 2010

In Special:Preferences, Misc tab try checking 'Do not show page content below diffs'. That should make your diffs quite faster (albeit with less information).

#Comment by The Evil IP address (talk | contribs)   20:03, 12 September 2010

Does "diff-multi-manyusers" support PLURAL for $1? I know it doesn't need this in /en, but it may be required in other languages.

#Comment by 😂 (talk | contribs)   20:05, 12 September 2010

Yes, it does.

#Comment by Nikerabbit (talk | contribs)   15:57, 13 September 2010

Ok from i18n point with the followup fixes.

Status & tagging log