persistRevisionThreadItems: Allow processing all pages in a namespace

Bug: T332745
Change-Id: I3014c9aab1df5aff6fe36742daef77b3b21a2445
This commit is contained in:
Bartosz Dziewoński 2023-03-21 23:48:52 +01:00
parent 62dbb8128b
commit 174533e41d

View file

@ -35,6 +35,7 @@ class PersistRevisionThreadItems extends Maintenance {
$this->addDescription( 'Persist thread item information for the given pages/revisions' );
$this->addOption( 'rev', 'Revision ID to process', false, true, false, true );
$this->addOption( 'page', 'Page title to process', false, true, false, true );
$this->addOption( 'namespace', 'Namespace number to process', false, true, false, true );
$this->addOption( 'all', 'Process the whole wiki' );
$this->addOption( 'current', 'Process current revisions only' );
$this->addOption( 'start', 'Restart from this position (as printed by the script)', false, true );
@ -56,6 +57,9 @@ class PersistRevisionThreadItems extends Maintenance {
if ( $this->getOption( 'all' ) ) {
// Do nothing
} elseif ( $this->getOption( 'namespace' ) ) {
$qb->where( [ 'page_namespace' => $this->getOption( 'namespace' ) ] );
} elseif ( $this->getOption( 'page' ) ) {
$linkBatch = $services->getLinkBatchFactory()->newLinkBatch();
foreach ( $this->getOption( 'page' ) as $page ) {