r49674 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49673‎ | r49674 | r49675 >
Date:19:17, 20 April 2009
Author:ialex
Status:ok (Comments)
Tags:
Comment:
* (bug 18121) maintenance/deleteArchivedRevisions.php no longer deletes revisions when --delete is not passed
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/deleteArchivedRevisions.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/deleteArchivedRevisions.inc
@@ -18,17 +18,24 @@
1919
2020 $tbl_arch = $dbw->tableName( 'archive' );
2121 # 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" );
2526
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" );
3341 }
34 -
3542 }
Index: trunk/phase3/RELEASE-NOTES
@@ -352,6 +352,8 @@
353353 <strong> instead of hardcoded styles
354354 * (bug 18449) Fixed items number per column on category pages when the total is
355355 divisible by 3
 356+* (bug 18121) maintenance/deleteArchivedRevisions.php no longer deletes
 357+ revisions when --delete is not passed
356358
357359 == API changes in 1.15 ==
358360 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

Comments

#Comment by Brion VIBBER (talk | contribs)   21:45, 28 April 2009

It says that it's deleting, so this is really just introducing a bug that makes it not work for no user-visible reason. :)

Needs UI fix -- indicate to the user that nothing will be deleted unless they pass the extra parameter, and tell them what it is!

#Comment by IAlex (talk | contribs)   20:35, 29 April 2009

fixed in r50052.

Status & tagging log