r104957 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104956‎ | r104957 | r104958 >
Date:06:44, 2 December 2011
Author:aaron
Status:deferred
Tags:
Comment:
Status related cleanups and fixes
Modified paths:
  • /branches/FileBackend/phase3/includes/filerepo/FileRepo.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/backend/FileBackend.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/backend/FileBackendMultiWrite.php (modified) (history)

Diff [purge]

Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackendMultiWrite.php
@@ -106,7 +106,7 @@
107107 if ( !empty( $ops[$index]['ignoreErrors'] ) ) {
108108 $failedOps[$index] = 1; // remember not to call attempt()/finish()
109109 ++$status->failCount;
110 - $status->value[$index] = false;
 110+ $status->success[$index] = false;
111111 } else {
112112 $status->merge( $this->unlockFiles( $filesToLock ) );
113113 return $status;
@@ -124,7 +124,7 @@
125125 if ( !empty( $ops[$index]['ignoreErrors'] ) ) {
126126 $failedOps[$index] = 1; // remember not to call finish()
127127 ++$status->failCount;
128 - $status->value[$index] = false;
 128+ $status->success[$index] = false;
129129 } else {
130130 // Revert everything done so far and abort.
131131 // Do this by reverting each previous operation in reverse order.
@@ -149,10 +149,10 @@
150150 $subStatus = $fileOp->finish();
151151 if ( $subStatus->isOK() ) {
152152 ++$status->successCount;
153 - $status->value[$index] = true;
 153+ $status->success[$index] = true;
154154 } else {
155155 ++$status->failCount;
156 - $status->value[$index] = false;
 156+ $status->success[$index] = false;
157157 }
158158 $status->merge( $subStatus );
159159 }
Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackend.php
@@ -441,7 +441,7 @@
442442 if ( !empty( $ops[$index]['ignoreErrors'] ) ) {
443443 $failedOps[$index] = 1; // remember not to call attempt()/finish()
444444 ++$status->failCount;
445 - $status->value[$index] = false;
 445+ $status->success[$index] = false;
446446 } else {
447447 $status->merge( $this->unlockFiles( $filesToLock ) );
448448 return $status;
@@ -459,7 +459,7 @@
460460 if ( !empty( $ops[$index]['ignoreErrors'] ) ) {
461461 $failedOps[$index] = 1; // remember not to call finish()
462462 ++$status->failCount;
463 - $status->value[$index] = false;
 463+ $status->success[$index] = false;
464464 } else {
465465 // Revert everything done so far and abort.
466466 // Do this by reverting each previous operation in reverse order.
@@ -484,10 +484,10 @@
485485 $subStatus = $fileOp->finish();
486486 if ( $subStatus->isOK() ) {
487487 ++$status->successCount;
488 - $status->value[$index] = true;
 488+ $status->success[$index] = true;
489489 } else {
490490 ++$status->failCount;
491 - $status->value[$index] = false;
 491+ $status->success[$index] = false;
492492 }
493493 $status->merge( $subStatus );
494494 }
Index: branches/FileBackend/phase3/includes/filerepo/FileRepo.php
@@ -808,6 +808,9 @@
809809 $status->merge( $this->backend->doOperations( $deleteOperations ) );
810810 }
811811
 812+ // Make sure status is OK, despite any $deleteOperations fatals
 813+ $status->setResult( true );
 814+
812815 return $status;
813816 }
814817

Status & tagging log