dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "rdbms: cleanup code for read-only propagation for master connections"
[lhc/web/wiklou.git]
/
includes
/
MergeHistory.php
diff --git
a/includes/MergeHistory.php
b/includes/MergeHistory.php
index
4c655eb
..
6bd4471
100644
(file)
--- a/
includes/MergeHistory.php
+++ b/
includes/MergeHistory.php
@@
-32,7
+32,7
@@
use Wikimedia\Rdbms\IDatabase;
*/
class MergeHistory {
*/
class MergeHistory {
- /**
@const int
Maximum number of revisions that can be merged at once */
+ /** Maximum number of revisions that can be merged at once */
const REVISION_LIMIT = 5000;
/** @var Title Page from which history will be merged */
const REVISION_LIMIT = 5000;
/** @var Title Page from which history will be merged */
@@
-254,6
+254,8
@@
class MergeHistory {
return $permCheck;
}
return $permCheck;
}
+ $this->dbw->startAtomic( __METHOD__ );
+
$this->dbw->update(
'revision',
[ 'rev_page' => $this->dest->getArticleID() ],
$this->dbw->update(
'revision',
[ 'rev_page' => $this->dest->getArticleID() ],
@@
-264,17
+266,17
@@
class MergeHistory {
// Check if this did anything
$this->revisionsMerged = $this->dbw->affectedRows();
if ( $this->revisionsMerged < 1 ) {
// Check if this did anything
$this->revisionsMerged = $this->dbw->affectedRows();
if ( $this->revisionsMerged < 1 ) {
+ $this->dbw->endAtomic( __METHOD__ );
$status->fatal( 'mergehistory-fail-no-change' );
$status->fatal( 'mergehistory-fail-no-change' );
+
return $status;
}
// Make the source page a redirect if no revisions are left
return $status;
}
// Make the source page a redirect if no revisions are left
- $haveRevisions = $this->dbw->
selectField
(
+ $haveRevisions = $this->dbw->
lockForUpdate
(
'revision',
'revision',
- 'rev_timestamp',
[ 'rev_page' => $this->source->getArticleID() ],
[ 'rev_page' => $this->source->getArticleID() ],
- __METHOD__,
- [ 'FOR UPDATE' ]
+ __METHOD__
);
if ( !$haveRevisions ) {
if ( $reason ) {
);
if ( !$haveRevisions ) {
if ( $reason ) {
@@
-350,6
+352,8
@@
class MergeHistory {
Hooks::run( 'ArticleMergeComplete', [ $this->source, $this->dest ] );
Hooks::run( 'ArticleMergeComplete', [ $this->source, $this->dest ] );
+ $this->dbw->endAtomic( __METHOD__ );
+
return $status;
}
}
return $status;
}
}