jenkins-bot has submitted this change and it was merged.

Change subject: Convert MovePage to startAtomic()/endAtomic()
......................................................................


Convert MovePage to startAtomic()/endAtomic()

* This makes moves of a page and its subpages atomic
  as one operation. Note that $wgMaximumMovedPages
  already bounds the number of page rows changed.
* The TitleMoveComplete hook will fire for all
  titles after the operation rather than after
  each title move.
* Remove LocalFile comment about it commiting the
  transaction because LocalFile::lock()/unlock()
  check trxLevel() and reference count.

Change-Id: Ic7f6964f94f0b0f0bedc27012e5b5b012a4afdb2
---
M includes/MovePage.php
1 file changed, 7 insertions(+), 6 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/MovePage.php b/includes/MovePage.php
index 2cd9698..0f9374a 100644
--- a/includes/MovePage.php
+++ b/includes/MovePage.php
@@ -247,7 +247,7 @@
                        RepoGroup::singleton()->clearCache( $this->newTitle ); 
# clear false negative cache
                }
 
-               $dbw->begin( __METHOD__ ); # If $file was a LocalFile, its 
transaction would have closed our own.
+               $dbw->startAtomic( __METHOD__ );
                $pageid = $this->oldTitle->getArticleID( Title::GAID_FOR_UPDATE 
);
                $protected = $this->oldTitle->isProtected();
 
@@ -369,12 +369,13 @@
                        WatchedItem::duplicateEntries( $this->oldTitle, 
$this->newTitle );
                }
 
-               $dbw->commit( __METHOD__ );
+               $dbw->endAtomic( __METHOD__ );
 
-               Hooks::run(
-                       'TitleMoveComplete',
-                       array( &$this->oldTitle, &$this->newTitle, &$user, 
$pageid, $redirid, $reason )
-               );
+               $params = array( $this->oldTitle, $this->newTitle, $user, 
$pageid, $redirid, $reason );
+               $dbw->onTransactionIdle( function () use ( $params ) {
+                       Hooks::run( 'TitleMoveComplete', $params );
+               } );
+
                return Status::newGood();
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/244044
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic7f6964f94f0b0f0bedc27012e5b5b012a4afdb2
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to