58 string $mergePointTimestamp,
59 string $mergePointTimestampOld
61 $this->mConds = $conds;
62 $this->articleID =
$source->getId();
65 $this->mergePointTimestamp = $mergePointTimestamp;
66 $this->mergePointTimestampOld = $mergePointTimestampOld;
70 parent::__construct( $context, $linkRenderer );
71 $this->linkBatchFactory = $linkBatchFactory;
72 $this->revisionStore = $revisionStore;
73 $this->commentFormatter = $commentFormatter;
74 $this->changeTagsStore = $changeTagsStore;
79 # Do a link batch query
80 $this->mResult->seek( 0 );
81 $batch = $this->linkBatchFactory->newLinkBatch()->setCaller( __METHOD__ );
82 # Give some pointers to make (last) links
85 foreach ( $this->mResult as $row ) {
86 $batch->addUser(
new UserIdentityValue( (
int)$row->rev_user, $row->rev_user_text ) );
88 if ( $rev_id !==
null ) {
89 if ( $rev_id > $row->rev_id ) {
90 $this->prevId[$rev_id] = $row->rev_id;
91 } elseif ( $rev_id < $row->rev_id ) {
92 $this->prevId[$row->rev_id] = $rev_id;
96 $rev_id = $row->rev_id;
100 $this->mResult->seek( 0 );
119 $revRecord = $this->revisionStore->newRevisionFromRow( $row );
124 $last = $this->
msg(
'last' )->escaped();
127 $tsWithId = $ts .
"|" . $row->rev_id;
128 $oldCheckBox = Html::radio(
130 $this->mergePointTimestampOld === $tsWithId,
131 [
'value' => $tsWithId ]
133 $newCheckBox = Html::radio(
135 $this->mergePointTimestamp === $ts || $this->mergePointTimestamp === $tsWithId,
136 [
'value' => $tsWithId ]
138 $cbs = $oldCheckBox . $newCheckBox;
142 $pageLink = $linkRenderer->makeKnownLink(
143 $revRecord->getPageAsLinkTarget(),
144 $this->getLanguage()->userTimeAndDate( $ts, $user ),
146 [
'oldid' => $revRecord->getId() ]
148 if ( $revRecord->isDeleted( RevisionRecord::DELETED_TEXT ) ) {
149 $class = Linker::getRevisionDeletedClass( $revRecord );
150 $pageLink =
'<span class=" ' . $class .
'">' . $pageLink .
'</span>';
154 if ( !$revRecord->userCan( RevisionRecord::DELETED_TEXT, $this->getAuthority() ) ) {
155 $last = $this->
msg(
'last' )->escaped();
156 } elseif ( isset( $this->prevId[$row->rev_id] ) ) {
157 $last = $linkRenderer->makeKnownLink(
158 $revRecord->getPageAsLinkTarget(),
159 $this->msg(
'last' )->text(),
162 'diff' => $row->rev_id,
163 'oldid' => $this->prevId[$row->rev_id]
168 $userLink = Linker::revUserTools( $revRecord );
170 $size = $row->rev_len;
171 if ( $size !==
null ) {
172 $stxt = Linker::formatRevisionSize( $size );
174 $comment = $this->commentFormatter->formatRevision( $revRecord, $user );
177 [ $tagSummary, $classes ] = ChangeTags::formatSummaryRow(
183 return Html::rawElement(
'li', $classes,
184 $this->
msg(
'mergehistory-revisionrow' )
185 ->rawParams( $cbs, $last, $pageLink, $userLink, $stxt, $comment, $tagSummary )->escaped() );