r113169 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113168‎ | r113169 | r113170 >
Date:19:21, 6 March 2012
Author:reedy
Status:ok
Tags:
Comment:
Minor followup to r111795, make doSha1LegacyUpdates return it's count value so it can be added to the count of archive rows

Don't return true in doSha1Updates(), return 0 if table is empty
Modified paths:
  • /trunk/phase3/maintenance/populateRevisionSha1.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/populateRevisionSha1.php
@@ -67,7 +67,7 @@
6868 $end = $db->selectField( $table, "MAX($idCol)", false, __METHOD__ );
6969 if ( !$start || !$end ) {
7070 $this->output( "...$table table seems to be empty.\n" );
71 - return true;
 71+ return 0;
7272 }
7373
7474 $count = 0;
@@ -95,7 +95,10 @@
9696 }
9797 return $count;
9898 }
99 -
 99+
 100+ /**
 101+ * @return int
 102+ */
100103 protected function doSha1LegacyUpdates() {
101104 $count = 0;
102105 $db = $this->getDB( DB_MASTER );
@@ -116,8 +119,16 @@
117120 }
118121 }
119122 $db->commit( __METHOD__ );
 123+ return $count;
120124 }
121125
 126+ /**
 127+ * @param $row
 128+ * @param $table
 129+ * @param $idCol
 130+ * @param $prefix
 131+ * @return bool
 132+ */
122133 protected function upgradeRow( $row, $table, $idCol, $prefix ) {
123134 $db = $this->getDB( DB_MASTER );
124135 if ( $table === 'archive' ) {
@@ -140,6 +151,10 @@
141152 }
142153 }
143154
 155+ /**
 156+ * @param $row
 157+ * @return bool
 158+ */
144159 protected function upgradeLegacyArchiveRow( $row ) {
145160 $db = $this->getDB( DB_MASTER );
146161 $rev = Revision::newFromArchiveRow( $row );

Follow-up revisions

RevisionCommit summaryAuthorDate
r113174MFT r111795, r111881, r111920, r112573, r112995, r113169reedy20:12, 6 March 2012
r113175MFT r111795, r111881, r111920, r112573, r112995, r113169reedy20:13, 6 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111795(bug 34373) - 'populateRevisionSha1.php misses archive rows, whose text is st...aaron21:48, 17 February 2012

Status & tagging log