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

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, 10 insertions(+), 0 deletions(-)

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



diff --git a/maintenance/importDump.php b/maintenance/importDump.php
index 6b7cfb6..43e5060 100644
--- a/maintenance/importDump.php
+++ b/maintenance/importDump.php
@@ -68,6 +68,8 @@
                $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 +287,14 @@
                if ( $this->hasOption( 'no-updates' ) ) {
                        $importer->setNoUpdates( true );
                }
+               if ( $this->hasOption( 'rootpage' ) ) {
+                       $statusRootPage = $importer->setTargetRootPage( 
$this->getOption( 'rootpage' ) );
+                       if ( !$statusRootPage->isGood() ) {
+                               // Die here so that it doesn't print "Done!"
+                               $this->error( 
$statusRootPage->getMessage()->text(), 1 );
+                               return false;
+                       }
+               }
                $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: merged
Gerrit-Change-Id: Ie026b091275668765ea06e947d45bed64354f2cb
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Unicornisaurous <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: TTO <[email protected]>
Gerrit-Reviewer: Unicornisaurous <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to