r113319 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113318‎ | r113319 | r113320 >
Date:23:04, 7 March 2012
Author:aaron
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1 (modified) (history)
  • /branches/wmf/1.19wmf1/includes (modified) (history)
  • /branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php
@@ -907,7 +907,10 @@
908908 $this->lock(); // begin
909909 $status = $this->publish( $srcPath, $flags );
910910
911 - if ( $status->ok ) {
 911+ if ( $status->successCount > 0 ) {
 912+ # Essentially we are displacing any existing current file and saving
 913+ # a new current file at the old location. If just the first succeeded,
 914+ # we still need to displace the current DB entry and put in a new one.
912915 if ( !$this->recordUpload2( $status->value, $comment, $pageText, $props, $timestamp, $user ) ) {
913916 $status->fatal( 'filenotfound', $srcPath );
914917 }
@@ -1004,8 +1007,12 @@
10051008 );
10061009
10071010 if ( $dbw->affectedRows() == 0 ) {
1008 - if ( $oldver == '' ) {
1009 - throw new MWException( "Empty oi_archive_name. Database and storage out of sync?" );
 1011+ if ( $oldver == '' ) { // XXX
 1012+ # (bug 34993) publish() can displace the current file and yet fail to save
 1013+ # a new one. The next publish attempt will treat the file as a brand new file
 1014+ # and pass an empty $oldver. Allow this bogus value so we can displace the
 1015+ # `image` row to `oldimage`, leaving room for the new current file `image` row.
 1016+ #throw new MWException( "Empty oi_archive_name. Database and storage out of sync?" );
10101017 }
10111018 $reupload = true;
10121019 # Collision, this is an update of a file
Property changes on: branches/wmf/1.19wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
10131020 Merged /trunk/phase3/includes:r113312
Property changes on: branches/wmf/1.19wmf1
___________________________________________________________________
Modified: svn:mergeinfo
10141021 Merged /trunk/phase3:r113312

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113312[FileRepo]...aaron22:46, 7 March 2012

Status & tagging log