$orderby[] = "rev_id $sort";
$this->addOption( 'ORDER BY', $orderby );
- $res = $this->select( __METHOD__ );
+ $hookData = [];
+ $res = $this->select( __METHOD__, [], $hookData );
$pageMap = []; // Maps rev_page to array index
$count = 0;
$nextIndex = 0;
$generated = [];
foreach ( $res as $row ) {
+ if ( $count === 0 && $resultPageSet !== null ) {
+ // Set the non-continue since the list of all revisions is
+ // prone to having entries added at the start frequently.
+ $this->getContinuationManager()->addGeneratorNonContinueParam(
+ $this, 'continue', "$row->rev_timestamp|$row->rev_id"
+ );
+ }
if ( ++$count > $this->limit ) {
// We've had enough
$this->setContinueEnumParameter( 'continue', "$row->rev_timestamp|$row->rev_id" );
];
ApiResult::setIndexedTagName( $a['revisions'], 'rev' );
ApiQueryBase::addTitleInfo( $a, $title );
- $fit = $result->addValue( [ 'query', $this->getModuleName() ], $index, $a );
+ $fit = $this->processRow( $row, $a['revisions'][0], $hookData ) &&
+ $result->addValue( [ 'query', $this->getModuleName() ], $index, $a );
} else {
$index = $pageMap[$row->rev_page];
- $fit = $result->addValue(
- [ 'query', $this->getModuleName(), $index, 'revisions' ],
- null, $rev );
+ $fit = $this->processRow( $row, $rev, $hookData ) &&
+ $result->addValue( [ 'query', $this->getModuleName(), $index, 'revisions' ], null, $rev );
}
if ( !$fit ) {
$this->setContinueEnumParameter( 'continue', "$row->rev_timestamp|$row->rev_id" );