Index: trunk/phase3/maintenance/deleteArchivedRevisions.inc |
— | — | @@ -18,17 +18,24 @@ |
19 | 19 | |
20 | 20 | $tbl_arch = $dbw->tableName( 'archive' ); |
21 | 21 | # Delete as appropriate |
22 | | - echo( "Deleting archived revisions..." ); |
23 | | - $dbw->query( "TRUNCATE TABLE $tbl_arch" ); |
24 | | - echo( "done.\n" ); |
| 22 | + echo( "Deleting archived revisions... " ); |
| 23 | + |
| 24 | + if( $delete ) { |
| 25 | + $dbw->query( "TRUNCATE TABLE $tbl_arch" ); |
25 | 26 | |
26 | | - $delete = $dbw->affectedRows() != 0; |
27 | | - |
28 | | - # This bit's done |
29 | | - # Purge redundant text records |
30 | | - $dbw->commit(); |
31 | | - if( $delete ) { |
32 | | - PurgeRedundantText( true ); |
| 27 | + $count = $dbw->affectedRows(); |
| 28 | + $deletedRows = $count != 0; |
| 29 | + |
| 30 | + echo( "done. $count revisions deleted.\n" ); |
| 31 | + |
| 32 | + # This bit's done |
| 33 | + # Purge redundant text records |
| 34 | + $dbw->commit(); |
| 35 | + if( $deletedRows ) { |
| 36 | + PurgeRedundantText( true ); |
| 37 | + } |
| 38 | + } else { |
| 39 | + $res = $dbw->selectRow( 'archive', 'COUNT(*) as count', array(), __FUNCTION__ ); |
| 40 | + echo( "done. {$res->count} revisions to delete.\n" ); |
33 | 41 | } |
34 | | - |
35 | 42 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -352,6 +352,8 @@ |
353 | 353 | <strong> instead of hardcoded styles |
354 | 354 | * (bug 18449) Fixed items number per column on category pages when the total is |
355 | 355 | divisible by 3 |
| 356 | +* (bug 18121) maintenance/deleteArchivedRevisions.php no longer deletes |
| 357 | + revisions when --delete is not passed |
356 | 358 | |
357 | 359 | == API changes in 1.15 == |
358 | 360 | * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions |