r85490 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85489‎ | r85490 | r85491 >
Date:23:28, 5 April 2011
Author:aaron
Status:ok
Tags:
Comment:
Follow up r85467: changed some countRevisionsBetween/countAuthorsBetween callers to pass in objects, which avoids queries
Modified paths:
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedArticleView.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -833,18 +833,18 @@
834834 return '';
835835 }
836836
837 - $oldid = $this->mOldRev->getId();
838 - $newid = $this->mNewRev->getId();
839 - if ( $oldid > $newid ) {
840 - $tmp = $oldid; $oldid = $newid; $newid = $tmp;
 837+ if ( $this->mOldRev->getTimestamp() > $this->mNewRev->getTimestamp() ) {
 838+ $oldRev = $this->mNewRev; // flip
 839+ $newRev = $this->mOldRev; // flip
 840+ } else { // normal case
 841+ $oldRev = $this->mOldRev;
 842+ $newRev = $this->mNewRev;
841843 }
842844
843 - $nEdits = $this->mTitle->countRevisionsBetween( $oldid, $newid );
 845+ $nEdits = $this->mTitle->countRevisionsBetween( $oldRev, $newRev );
844846 if ( $nEdits > 0 ) {
845 - $limit = 100;
846 - // We use ($limit + 1) so we can detect if there are > 100 authors
847 - // in a given revision range. In that case, diff-multi-manyusers is used.
848 - $numUsers = $this->mTitle->countAuthorsBetween( $oldid, $newid, $limit );
 847+ $limit = 100; // use diff-multi-manyusers if too many users
 848+ $numUsers = $this->mTitle->countAuthorsBetween( $oldRev, $newRev, $limit );
849849 return self::intermediateEditsMsg( $nEdits, $numUsers, $limit );
850850 }
851851 return ''; // nothing
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedArticleView.php
@@ -1368,7 +1368,7 @@
13691369 {
13701370 $title = $this->article->getTitle(); // convenience
13711371 // @TODO: make diff class cache this
1372 - $n = $title->countRevisionsBetween( $oldRev->getId(), $newRev->getId() );
 1372+ $n = $title->countRevisionsBetween( $oldRev, $newRev );
13731373 if ( $n ) {
13741374 $msg = 'revreview-update-edited-prev'; // previous pending edits
13751375 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85467* Cleanups to getFirstRevision and getEarliestTime...aaron20:42, 5 April 2011

Status & tagging log