88 $this->mConds = $conds;
89 $this->articleID =
$source->getId();
92 $maxtimestamp = $dbr->newSelectQueryBuilder()
93 ->select(
'MIN(rev_timestamp)' )
95 ->where( [
'rev_page' => $dest->
getId() ] )
96 ->caller( __METHOD__ )->fetchField();
97 $this->maxTimestamp = $maxtimestamp;
98 $this->mergePointTimestamp = $mergePointTimestamp;
102 parent::__construct( $context, $linkRenderer );
103 $this->linkBatchFactory = $linkBatchFactory;
104 $this->revisionStore = $revisionStore;
105 $this->commentFormatter = $commentFormatter;
109 # Do a link batch query
110 $this->mResult->seek( 0 );
111 $batch = $this->linkBatchFactory->newLinkBatch();
112 # Give some pointers to make (last) links
115 foreach ( $this->mResult as $row ) {
116 $batch->add(
NS_USER, $row->rev_user_text );
119 if ( isset( $rev_id ) ) {
120 if ( $rev_id > $row->rev_id ) {
121 $this->prevId[$rev_id] = $row->rev_id;
122 } elseif ( $rev_id < $row->rev_id ) {
123 $this->prevId[$row->rev_id] = $rev_id;
127 $rev_id = $row->rev_id;
131 $this->mResult->seek( 0 );
149 $revRecord = $this->revisionStore->newRevisionFromRow( $row );
154 $last = $this->
msg(
'last' )->escaped();
157 $checkBox = Xml::radio(
'mergepoint', $ts, ( $this->mergePointTimestamp === $ts ) );
161 $pageLink = $linkRenderer->makeKnownLink(
162 $revRecord->getPageAsLinkTarget(),
163 $this->getLanguage()->userTimeAndDate( $ts, $user ),
165 [
'oldid' => $revRecord->getId() ]
167 if ( $revRecord->isDeleted( RevisionRecord::DELETED_TEXT ) ) {
168 $class = Linker::getRevisionDeletedClass( $revRecord );
169 $pageLink =
'<span class=" ' . $class .
'">' . $pageLink .
'</span>';
173 if ( !$revRecord->userCan( RevisionRecord::DELETED_TEXT, $this->getAuthority() ) ) {
174 $last = $this->
msg(
'last' )->escaped();
175 } elseif ( isset( $this->prevId[$row->rev_id] ) ) {
176 $last = $linkRenderer->makeKnownLink(
177 $revRecord->getPageAsLinkTarget(),
178 $this->msg(
'last' )->text(),
181 'diff' => $row->rev_id,
182 'oldid' => $this->prevId[$row->rev_id]
187 $userLink = Linker::revUserTools( $revRecord );
189 $size = $row->rev_len;
190 if ( $size !==
null ) {
191 $stxt = Linker::formatRevisionSize( $size );
193 $comment = $this->commentFormatter->formatRevision( $revRecord, $user );
202 return Html::rawElement(
'li', $classes,
203 $this->
msg(
'mergehistory-revisionrow' )
204 ->rawParams( $checkBox, $last, $pageLink, $userLink, $stxt, $comment, $tagSummary )->escaped() );