summaryrefslogtreecommitdiff
path: root/maintenance/populateRevisionSha1.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /maintenance/populateRevisionSha1.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'maintenance/populateRevisionSha1.php')
-rw-r--r--maintenance/populateRevisionSha1.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/maintenance/populateRevisionSha1.php b/maintenance/populateRevisionSha1.php
index 2e14d31e..113eef49 100644
--- a/maintenance/populateRevisionSha1.php
+++ b/maintenance/populateRevisionSha1.php
@@ -48,6 +48,9 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
$this->error( "revision table does not exist", true );
} elseif ( !$db->tableExists( 'archive' ) ) {
$this->error( "archive table does not exist", true );
+ } else if ( !$db->fieldExists( 'revision', 'rev_sha1', __METHOD__ ) ) {
+ $this->output( "rev_sha1 column does not exist\n\n", true );
+ return false;
}
$this->output( "Populating rev_sha1 column\n" );
@@ -143,14 +146,14 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
$rev = ( $table === 'archive' )
? Revision::newFromArchiveRow( $row )
: new Revision( $row );
- $text = $rev->getRawText();
+ $text = $rev->getSerializedData();
} catch ( MWException $e ) {
- $this->output( "Text of revision with {$idCol}={$row->$idCol} unavailable!\n" );
+ $this->output( "Data of revision with {$idCol}={$row->$idCol} unavailable!\n" );
return false; // bug 22624?
}
if ( !is_string( $text ) ) {
# This should not happen, but sometimes does (bug 20757)
- $this->output( "Text of revision with {$idCol}={$row->$idCol} unavailable!\n" );
+ $this->output( "Data of revision with {$idCol}={$row->$idCol} unavailable!\n" );
return false;
} else {
$db->update( $table,
@@ -174,10 +177,10 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
$this->output( "Text of revision with timestamp {$row->ar_timestamp} unavailable!\n" );
return false; // bug 22624?
}
- $text = $rev->getRawText();
+ $text = $rev->getSerializedData();
if ( !is_string( $text ) ) {
# This should not happen, but sometimes does (bug 20757)
- $this->output( "Text of revision with timestamp {$row->ar_timestamp} unavailable!\n" );
+ $this->output( "Data of revision with timestamp {$row->ar_timestamp} unavailable!\n" );
return false;
} else {
# Archive table as no PK, but (NS,title,time) should be near unique.