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

Change subject: Add --noredirects parameter to moveBatch.php
......................................................................


Add --noredirects parameter to moveBatch.php

Bug: 57077
Change-Id: I8dc1cdc365c5ba09106b9562ce2768fdcf8e5b95
---
M maintenance/moveBatch.php
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/maintenance/moveBatch.php b/maintenance/moveBatch.php
index 34e6428..f991c1b 100644
--- a/maintenance/moveBatch.php
+++ b/maintenance/moveBatch.php
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  * @author Tim Starling
  *
- * USAGE: php moveBatch.php [-u <user>] [-r <reason>] [-i <interval>] 
[listfile]
+ * USAGE: php moveBatch.php [-u <user>] [-r <reason>] [-i <interval>] 
[-noredirects] [listfile]
  *
  * [listfile] - file with two titles per line, separated with pipe characters;
  * the first title is the source, the second is the destination.
@@ -29,6 +29,7 @@
  * <user> - username to perform moves as
  * <reason> - reason to be given for moves
  * <interval> - number of seconds to sleep after each move
+ * <noredirects> - suppress creation of redirects
  *
  * This will print out error codes from Title::moveTo() if something goes 
wrong,
  * e.g. immobile_namespace for namespaces which can't be moved
@@ -48,6 +49,7 @@
                $this->addOption( 'u', "User to perform move", false, true );
                $this->addOption( 'r', "Reason to move page", false, true );
                $this->addOption( 'i', "Interval to sleep between moves" );
+               $this->addOption( 'noredirects', "Suppress creation of 
redirects" );
                $this->addArg( 'listfile', 'List of pages to move, newline 
delimited', false );
        }
 
@@ -62,6 +64,7 @@
                $user = $this->getOption( 'u', 'Move page script' );
                $reason = $this->getOption( 'r', '' );
                $interval = $this->getOption( 'i', 0 );
+               $noredirects = $this->getOption( 'noredirects', false );
                if ( $this->hasArg() ) {
                        $file = fopen( $this->getArg(), 'r' );
                } else {
@@ -99,7 +102,7 @@
 
                        $this->output( $source->getPrefixedText() . ' --> ' . 
$dest->getPrefixedText() );
                        $dbw->begin( __METHOD__ );
-                       $err = $source->moveTo( $dest, false, $reason );
+                       $err = $source->moveTo( $dest, false, $reason, 
!$noredirects );
                        if ( $err !== true ) {
                                $msg = array_shift( $err[0] );
                                $this->output( "\nFAILED: " . wfMessage( $msg, 
$err[0] )->text() );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8dc1cdc365c5ba09106b9562ce2768fdcf8e5b95
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: leucosticte <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to