r50052 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50051‎ | r50052 | r50053 >
Date:20:34, 29 April 2009
Author:ialex
Status:ok
Tags:
Comment:
Per Brion's comment: fix the UI to make clear that revisions are deleted only when the --delete option is passed
Modified paths:
  • /trunk/phase3/maintenance/deleteArchivedRevisions.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/deleteArchivedRevisions.inc
@@ -14,13 +14,14 @@
1515
1616 # Data should come off the master, wrapped in a transaction
1717 $dbw = wfGetDB( DB_MASTER );
18 - $dbw->begin();
 18+
 19+ if( $delete ) {
 20+ $dbw->begin();
1921
20 - $tbl_arch = $dbw->tableName( 'archive' );
21 - # Delete as appropriate
22 - echo( "Deleting archived revisions... " );
 22+ $tbl_arch = $dbw->tableName( 'archive' );
2323
24 - if( $delete ) {
 24+ # Delete as appropriate
 25+ echo( "Deleting archived revisions... " );
2526 $dbw->query( "TRUNCATE TABLE $tbl_arch" );
2627
2728 $count = $dbw->affectedRows();
@@ -36,6 +37,7 @@
3738 }
3839 } else {
3940 $res = $dbw->selectRow( 'archive', 'COUNT(*) as count', array(), __FUNCTION__ );
40 - echo( "done. {$res->count} revisions to delete.\n" );
 41+ echo( "Found {$res->count} revisions to delete.\n" );
 42+ echo( "Please run the script again with the --delete option to really delete the revisions.\n" );
4143 }
4244 }

Status & tagging log