From: Alexandre Emsenhuber Date: Wed, 29 Apr 2009 20:34:33 +0000 (+0000) Subject: Per Brion's comment: fix the UI to make clear that revisions are deleted only when... X-Git-Tag: 1.31.0-rc.0~41935 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=8037f592e8b2a107240e4c38cce969ec46a5be5d;p=lhc%2Fweb%2Fwiklou.git Per Brion's comment: fix the UI to make clear that revisions are deleted only when the --delete option is passed --- diff --git a/maintenance/deleteArchivedRevisions.inc b/maintenance/deleteArchivedRevisions.inc index 3cfa614ac8..cd90ecdf46 100644 --- a/maintenance/deleteArchivedRevisions.inc +++ b/maintenance/deleteArchivedRevisions.inc @@ -14,13 +14,14 @@ function DeleteArchivedRevisions( $delete = false ) { # Data should come off the master, wrapped in a transaction $dbw = wfGetDB( DB_MASTER ); - $dbw->begin(); - - $tbl_arch = $dbw->tableName( 'archive' ); - # Delete as appropriate - echo( "Deleting archived revisions... " ); if( $delete ) { + $dbw->begin(); + + $tbl_arch = $dbw->tableName( 'archive' ); + + # Delete as appropriate + echo( "Deleting archived revisions... " ); $dbw->query( "TRUNCATE TABLE $tbl_arch" ); $count = $dbw->affectedRows(); @@ -36,6 +37,7 @@ function DeleteArchivedRevisions( $delete = false ) { } } else { $res = $dbw->selectRow( 'archive', 'COUNT(*) as count', array(), __FUNCTION__ ); - echo( "done. {$res->count} revisions to delete.\n" ); + echo( "Found {$res->count} revisions to delete.\n" ); + echo( "Please run the script again with the --delete option to really delete the revisions.\n" ); } }