r82917 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82916‎ | r82917 | r82918 >
Date:22:01, 27 February 2011
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
(bug 23415) Mark articles as needing review if a file version used in the stable version was deleted (which makes the draft/stable unsynced), even if the file still exists (has a current version). This can happen by selective deletion or moving files to Commons and such.
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php
@@ -675,7 +675,7 @@
676676 * (b) Current file exists and the "version used" was non-existing (created)
677677 * (c) Current file doesn't exist and the "version used" existed (deleted)
678678 *
679 - * @param string $noForeign Using 'noForeign' skips new non-local file versions (bug 15748)
 679+ * @param string $noForeign Using 'noForeign' skips foreign file updates (bug 15748)
680680 * @return Array of (file title, MW file timestamp in reviewed version) tuples
681681 */
682682 public function findPendingFileChanges( $noForeign = false ) {
@@ -718,18 +718,22 @@
719719 } else {
720720 $tsStable = $reviewedTS;
721721 }
722 - # Compare to current...
 722+ # Compare this version to the current version and check for things
 723+ # that would make the stable version unsynced with the draft...
723724 $file = wfFindFile( $title ); // current file version
724725 if ( $file ) { // file exists
725726 if ( $noForeign === 'noForeign' && !$file->isLocal() ) {
 727+ # Avoid counting edits to Commons files, which can effect
 728+ # many pages, as there is no expedient way to review them.
726729 $updated = !$tsStable; // created (ignore new versions)
727730 } else {
728731 $updated = ( $file->getTimestamp() > $tsStable ); // edited/created
729732 }
730 - $deleted = false;
 733+ $deleted = $tsStable // included file deleted after review
 734+ && !$file->getRepo()->findFile( $title, array( 'time' => $tsStable ) );
731735 } else { // file doesn't exists
732736 $updated = false;
733 - $deleted = (bool)$tsStable; // later deleted
 737+ $deleted = (bool)$tsStable; // included file deleted after review
734738 }
735739 if ( $deleted || $updated ) {
736740 $fileChanges[] = array( $title, $tsStable );

Sign-offs

UserFlagDate
Tim Starlinginspected07:02, 1 September 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r82919Fixed premature optimization in r82917 (we may have many repos)aaron22:20, 27 February 2011
r85033MFT more extension revs: r82601, r82654, r82698, r82755, r82756, r82759, r829...demon18:49, 30 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r67964* Redid pending file/template checks. (bug 23415)...aaron21:48, 13 June 2010
r68057* Rewrote stableVersionIsSynced() to use findPendingTemplateChanges()/findPen...aaron03:53, 15 June 2010

Comments

#Comment by Umherirrender (talk | contribs)   20:36, 22 April 2011

Why was this (and other) revision only marked with "1.17" and not with "1.17wmf1"?

#Comment by Reedy (talk | contribs)   20:37, 22 April 2011

Cause FR will get batch merged out, but only specific stuff need manually merging to 1.17

#Comment by Umherirrender (talk | contribs)   20:49, 22 April 2011

It is planned to merge the FlaggedRevs changes to 1.17wmf1? When get it merged? Thanks.

Status & tagging log