r96321 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96320‎ | r96321 | r96322 >
Date:11:31, 6 September 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 29916) add follow-up fetching to CR API

eg

<source lang="xml">
<revision revid="96307">
<followups>
<followups revid="96308" status="new" timestamp="2011-09-05T21:53:20Z" author="krinkle" xml:space="preserve">mediawiki.html: mediawiki.html: Add support for numbers and booleans
* Tests introduced in r96305 work now
* (bug 30774) - mediawiki.html: Add support for numbers and booleans
--
* Removed unneeded value-attribute in one the tests
* Changed if-else intro a switch. (to avoid calling the typeof operator multiple times and making the code a bit more readable)</followups>
<followups revid="96310" status="new" timestamp="2011-09-05T23:10:33Z" author="krinkle" xml:space="preserve">mediawiki.html: mediawiki.html: Add support for numbers and booleans
* Tests introduced in r96305 work now
* (bug 30774) - mediawiki.html: Add support for numbers and booleans
--
* Removed unneeded value-attribute in one the tests
* Changed if-else intro a switch. (to avoid calling the typeof operator multiple times and making the code a bit more readable)</followups>
</followups>
</revision>
</source>
Modified paths:
  • /trunk/extensions/CodeReview/api/ApiQueryCodeRevisions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/api/ApiQueryCodeRevisions.php
@@ -127,11 +127,31 @@
128128 if ( isset( $this->props['timestamp'] ) ) {
129129 $item['timestamp'] = wfTimestamp( TS_ISO_8601, $row->cr_timestamp );
130130 }
 131+ $rev = null;
131132 if ( isset( $this->props['tags'] ) ) {
132133 $rev = CodeRevision::newFromRow( $repo, $row );
133 - $item['tags'] = $rev->getTags( );
 134+ $item['tags'] = $rev->getTags();
134135 $result->setIndexedTagName( $item['tags'], 'tags' );
135136 }
 137+ if ( isset( $this->props['followups'] ) ) {
 138+ if ( $rev === null ) {
 139+ $rev = CodeRevision::newFromRow( $repo, $row );
 140+ }
 141+ $item['followups'] = array();
 142+ foreach ( $rev->getReferences() as $ref ) {
 143+ $refItem = array(
 144+ 'revid' => $ref->cr_id,
 145+ 'status' => $ref->cr_status,
 146+ 'timestamp' => wfTimestamp( TS_ISO_8601, $ref->cr_timestamp ),
 147+ 'author' => $ref->cr_author ,
 148+ );
 149+ ApiResult::setContent( $refItem, $row->cr_message );
 150+
 151+ $item['followups'][] = $refItem;
 152+ }
 153+
 154+ $result->setIndexedTagName( $item['followups'], 'followups' );
 155+ }
136156 return $item;
137157 }
138158
@@ -169,6 +189,7 @@
170190 'author',
171191 'tags',
172192 'timestamp',
 193+ 'followups',
173194 ),
174195 ),
175196 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96305mediawiki.html: Add broken tests for numbers and booleans...krinkle21:25, 5 September 2011
r96307mediawiki.html: mediawiki.html: Add support for numbers and booleans...krinkle21:51, 5 September 2011

Status & tagging log