r106570 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106569‎ | r106570 | r106571 >
Date:16:35, 18 December 2011
Author:aaron
Status:ok (Comments)
Tags:lamecommitsummary 
Comment:
FU r106514: use base 16 SHA-1 to be consistent with image info
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryDeletedrevs.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php
@@ -236,7 +236,7 @@
237237 $rev['len'] = $row->ar_len;
238238 }
239239 if ( $fld_sha1 ) {
240 - $rev['sha1'] = $row->ar_sha1;
 240+ $rev['sha1'] = wfBaseConvert( $row->ar_sha1, 36, 16, 40 );
241241 }
242242 if ( $fld_content ) {
243243 ApiResult::setContent( $rev, Revision::getRevisionText( $row ) );
@@ -347,7 +347,7 @@
348348 ' parsedcomment - Adds the parsed comment of the revision',
349349 ' minor - Tags if the revision is minor',
350350 ' len - Adds the length (bytes) of the revision',
351 - ' sha1 - Adds the SHA-1 (base 36) of the revision',
 351+ ' sha1 - Adds the SHA-1 (base 16) of the revision',
352352 ' content - Adds the content of the revision',
353353 ' token - Gives the edit token',
354354 ),
Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -414,7 +414,7 @@
415415 }
416416
417417 if ( $this->fld_sha1 ) {
418 - $vals['sha1'] = $revision->getSha1();
 418+ $vals['sha1'] = wfBaseConvert( $revision->getSha1(), 36, 16, 40 );
419419 }
420420
421421 if ( $this->fld_comment || $this->fld_parsedcomment ) {
@@ -606,7 +606,7 @@
607607 ' user - User that made the revision',
608608 ' userid - User id of revision creator',
609609 ' size - Length (bytes) of the revision',
610 - ' sha1 - SHA-1 (base 36) the revision',
 610+ ' sha1 - SHA-1 (base 16) the revision',
611611 ' comment - Comment by the user for revision',
612612 ' parsedcomment - Parsed comment by the user for the revision',
613613 ' content - Text of the revision',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106514Expose rev_sha1/ar_sha1 to API (bug 21860)aaron18:27, 17 December 2011

Comments

#Comment by Johnduhart (talk | contribs)   16:58, 18 December 2011

This should get a RELEASE-NOTES entry imo

#Comment by Aaron Schulz (talk | contribs)   16:59, 18 December 2011

That a new SHA-1 field was added to the output?

#Comment by Johnduhart (talk | contribs)   17:03, 18 December 2011

Oops, forgot sha1 for revisions is a 1.19 feature.

Status & tagging log