Index: trunk/phase3/includes/actions/HistoryAction.php |
— | — | @@ -498,7 +498,7 @@ |
499 | 499 | * @todo document some more, and maybe clean up the code (some params redundant?) |
500 | 500 | * |
501 | 501 | * @param $row Object: the database row corresponding to the previous line. |
502 | | - * @param $next Mixed: the database row corresponding to the next line. |
| 502 | + * @param $next Mixed: the database row corresponding to the next line. (chronologically previous) |
503 | 503 | * @param $notificationtimestamp |
504 | 504 | * @param $latest Boolean: whether this row corresponds to the page's latest revision. |
505 | 505 | * @param $firstInList Boolean: whether this row corresponds to the first displayed on this history page. |
— | — | @@ -510,6 +510,13 @@ |
511 | 511 | $rev = new Revision( $row ); |
512 | 512 | $rev->setTitle( $this->getTitle() ); |
513 | 513 | |
| 514 | + if ( is_object( $next ) ) { |
| 515 | + $prevRev = new Revision( $next ); |
| 516 | + $prevRev->setTitle( $this->getTitle() ); |
| 517 | + } else { |
| 518 | + $prevRev = null; |
| 519 | + } |
| 520 | + |
514 | 521 | $curlink = $this->curLink( $rev, $latest ); |
515 | 522 | $lastlink = $this->lastLink( $rev, $next ); |
516 | 523 | $diffButtons = $this->diffButtons( $rev, $firstInList ); |
— | — | @@ -566,8 +573,12 @@ |
567 | 574 | $s .= ' ' . ChangesList::flag( 'minor' ); |
568 | 575 | } |
569 | 576 | |
570 | | - if ( !is_null( $size = $rev->getSize() ) && !$rev->isDeleted( Revision::DELETED_TEXT ) ) { |
571 | | - $s .= ' ' . Linker::formatRevisionSize( $size ); |
| 577 | + if ( $prevRev |
| 578 | + && !$prevRev->isDeleted( Revision::DELETED_TEXT ) |
| 579 | + && !$rev->isDeleted( Revision::DELETED_TEXT ) ) |
| 580 | + { |
| 581 | + $sDiff = ChangesList::showCharacterDifference( $prevRev->getSize(), $rev->getSize() ); |
| 582 | + $s .= ' . . ' . $sDiff . ' . . '; |
572 | 583 | } |
573 | 584 | |
574 | 585 | $s .= Linker::revComment( $rev, false, true ); |
— | — | @@ -579,7 +590,7 @@ |
580 | 591 | $tools = array(); |
581 | 592 | |
582 | 593 | # Rollback and undo links |
583 | | - if ( !is_null( $next ) && is_object( $next ) && |
| 594 | + if ( $prevRev && |
584 | 595 | !count( $this->getTitle()->getUserPermissionsErrors( 'edit', $this->getUser() ) ) ) |
585 | 596 | { |
586 | 597 | if ( $latest && !count( $this->getTitle()->getUserPermissionsErrors( 'rollback', $this->getUser() ) ) ) { |
— | — | @@ -589,7 +600,7 @@ |
590 | 601 | } |
591 | 602 | |
592 | 603 | if ( !$rev->isDeleted( Revision::DELETED_TEXT ) |
593 | | - && !$next->rev_deleted & Revision::DELETED_TEXT ) |
| 604 | + && !$prevRev->isDeleted( Revision::DELETED_TEXT ) ) |
594 | 605 | { |
595 | 606 | # Create undo tooltip for the first (=latest) line only |
596 | 607 | $undoTooltip = $latest |
— | — | @@ -600,9 +611,9 @@ |
601 | 612 | $this->msg( 'editundo' )->escaped(), |
602 | 613 | $undoTooltip, |
603 | 614 | array( |
604 | | - 'action' => 'edit', |
605 | | - 'undoafter' => $next->rev_id, |
606 | | - 'undo' => $rev->getId() |
| 615 | + 'action' => 'edit', |
| 616 | + 'undoafter' => $prevRev->getId(), |
| 617 | + 'undo' => $rev->getId() |
607 | 618 | ) |
608 | 619 | ); |
609 | 620 | $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>"; |
Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -549,18 +549,14 @@ |
550 | 550 | } |
551 | 551 | |
552 | 552 | function doBatchLookups() { |
553 | | - global $wgRCShowChangedSize; |
554 | | - |
555 | | - $this->mParentLens = array(); |
556 | | - if ( $wgRCShowChangedSize ) { |
557 | | - $this->mResult->rewind(); |
558 | | - $revIds = array(); |
559 | | - foreach ( $this->mResult as $row ) { |
560 | | - $revIds[] = $row->rev_parent_id; |
561 | | - } |
562 | | - $this->mParentLens = $this->getParentLengths( $revIds ); |
563 | | - $this->mResult->rewind(); // reset |
| 553 | + $this->mResult->rewind(); |
| 554 | + $revIds = array(); |
| 555 | + foreach ( $this->mResult as $row ) { |
| 556 | + $revIds[] = $row->rev_parent_id; |
564 | 557 | } |
| 558 | + $this->mParentLens = $this->getParentLengths( $revIds ); |
| 559 | + $this->mResult->rewind(); // reset |
| 560 | + |
565 | 561 | if ( $this->contribs === 'newbie' ) { // multiple users |
566 | 562 | # Do a link batch query |
567 | 563 | $this->mResult->seek( 0 ); |