Index: trunk/phase3/maintenance/deleteArchivedRevisions.inc |
— | — | @@ -14,13 +14,14 @@ |
15 | 15 | |
16 | 16 | # Data should come off the master, wrapped in a transaction |
17 | 17 | $dbw = wfGetDB( DB_MASTER ); |
18 | | - $dbw->begin(); |
| 18 | + |
| 19 | + if( $delete ) { |
| 20 | + $dbw->begin(); |
19 | 21 | |
20 | | - $tbl_arch = $dbw->tableName( 'archive' ); |
21 | | - # Delete as appropriate |
22 | | - echo( "Deleting archived revisions... " ); |
| 22 | + $tbl_arch = $dbw->tableName( 'archive' ); |
23 | 23 | |
24 | | - if( $delete ) { |
| 24 | + # Delete as appropriate |
| 25 | + echo( "Deleting archived revisions... " ); |
25 | 26 | $dbw->query( "TRUNCATE TABLE $tbl_arch" ); |
26 | 27 | |
27 | 28 | $count = $dbw->affectedRows(); |
— | — | @@ -36,6 +37,7 @@ |
37 | 38 | } |
38 | 39 | } else { |
39 | 40 | $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" ); |
41 | 43 | } |
42 | 44 | } |