Unicornisaurous has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/261031

Change subject: Add --rootpage parameter to importDump.php
......................................................................

Add --rootpage parameter to importDump.php

The --rootpage parameter will import pages as subpages
of a specified page.

Bug: T72272
Change-Id: Ie026b091275668765ea06e947d45bed64354f2cb
---
M maintenance/importDump.php
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/31/261031/1

diff --git a/maintenance/importDump.php b/maintenance/importDump.php
index 6b7cfb6..1a60e12 100644
--- a/maintenance/importDump.php
+++ b/maintenance/importDump.php
@@ -68,6 +68,7 @@
                $this->addOption( 'namespaces',
                        'Import only the pages from namespaces belonging to the 
list of ' .
                        'pipe-separated namespace names or namespace indexes', 
false, true );
+               $this->addOption( 'rootpage', 'Pages will be imported as 
subpages of the specified page', false, true );
                $this->addOption( 'dry-run', 'Parse dump without actually 
importing pages' );
                $this->addOption( 'debug', 'Output extra verbose debug 
information' );
                $this->addOption( 'uploads', 'Process file upload data if 
included (experimental)' );
@@ -285,6 +286,13 @@
                if ( $this->hasOption( 'no-updates' ) ) {
                        $importer->setNoUpdates( true );
                }
+               if ( $this->hasOption( 'rootpage' ) ) {
+                       $statusRootPage = $importer->setTargetRootPage( 
$this->getOption( 'rootpage' ) );
+                       if ( !$statusRootPage->isGood() ) {
+                               $this->error( 'Invalid rootpage parameter', 420 
); // die here so that it doesn't print "Done!"
+                               return;
+                       }
+               }
                $importer->setPageCallback( array( &$this, 'reportPage' ) );
                $this->importCallback = $importer->setRevisionCallback(
                        array( &$this, 'handleRevision' ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie026b091275668765ea06e947d45bed64354f2cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Unicornisaurous <[email protected]>

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

Reply via email to