r38277 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38276‎ | r38277 | r38278 >
Date:07:39, 31 July 2008
Author:aaron
Status:old
Tags:
Comment:
set baserevid (part of bug 14984)
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -2602,6 +2602,7 @@
26032603 $now = wfTimestampNow();
26042604 $newid = $nt->getArticleID();
26052605 $oldid = $this->getArticleID();
 2606+ $latest = $this->getLatestRevID();
26062607
26072608 $dbw = wfGetDB( DB_MASTER );
26082609 $dbw->begin();
@@ -2630,7 +2631,7 @@
26312632 $nullRevId = $nullRevision->insertOn( $dbw );
26322633
26332634 $article = new Article( $this );
2634 - wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, false) );
 2635+ wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, $latest) );
26352636
26362637 # Change the name of the target page:
26372638 $dbw->update( 'page',
@@ -2716,6 +2717,7 @@
27172718
27182719 $newid = $nt->getArticleID();
27192720 $oldid = $this->getArticleID();
 2721+ $latest = $this->getLatestRevId();
27202722
27212723 $dbw = wfGetDB( DB_MASTER );
27222724 $dbw->begin();
@@ -2726,7 +2728,7 @@
27272729 $nullRevId = $nullRevision->insertOn( $dbw );
27282730
27292731 $article = new Article( $this );
2730 - wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, false) );
 2732+ wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, $latest) );
27312733
27322734 # Rename page entry
27332735 $dbw->update( 'page',
@@ -2941,16 +2943,16 @@
29422944 /**
29432945 * Get the revision ID of the previous revision
29442946 *
2945 - * @param integer $revision Revision ID. Get the revision that was before this one.
 2947+ * @param integer $revId Revision ID. Get the revision that was before this one.
29462948 * @param integer $flags, GAID_FOR_UPDATE
29472949 * @return integer $oldrevision|false
29482950 */
2949 - public function getPreviousRevisionID( $revision, $flags=0 ) {
 2951+ public function getPreviousRevisionID( $revId, $flags=0 ) {
29502952 $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
29512953 return $db->selectField( 'revision', 'rev_id',
29522954 array(
29532955 'rev_page' => $this->getArticleId($flags),
2954 - 'rev_id < ' . intval( $revision )
 2956+ 'rev_id < ' . intval( $revId )
29552957 ),
29562958 __METHOD__,
29572959 array( 'ORDER BY' => 'rev_id DESC' )
@@ -2960,16 +2962,16 @@
29612963 /**
29622964 * Get the revision ID of the next revision
29632965 *
2964 - * @param integer $revision Revision ID. Get the revision that was after this one.
 2966+ * @param integer $revId Revision ID. Get the revision that was after this one.
29652967 * @param integer $flags, GAID_FOR_UPDATE
29662968 * @return integer $oldrevision|false
29672969 */
2968 - public function getNextRevisionID( $revision, $flags=0 ) {
 2970+ public function getNextRevisionID( $revId, $flags=0 ) {
29692971 $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
29702972 return $db->selectField( 'revision', 'rev_id',
29712973 array(
29722974 'rev_page' => $this->getArticleId($flags),
2973 - 'rev_id > ' . intval( $revision )
 2975+ 'rev_id > ' . intval( $revId )
29742976 ),
29752977 __METHOD__,
29762978 array( 'ORDER BY' => 'rev_id' )

Follow-up revisions

RevisionCommit summaryAuthorDate
r38278Some fixes for move autosighting (bug 14984)aaron07:40, 31 July 2008

Status & tagging log