After a report in IRC...
$this->addOption( 'username-prefix', 'Prefix for interwiki usernames', false, true ); $this->addOption( 'no-local-users', 'Treat all usernames as interwiki. ' . 'The default is to assign edits to local users where they exist.', false, false );
But if we look how they're used...
if ( $this->hasOption( 'username-prefix' ) ) { $importer->setUsernamePrefix( $this->getOption( 'username-prefix' ), !$this->hasOption( 'no-local-users' ) ); }
which calls
/** * @since 1.31 * @param string $usernamePrefix Prefix to apply to unknown (and possibly also known) usernames * @param bool $assignKnownUsers Whether to apply the prefix to usernames that exist locally */ public function setUsernamePrefix( $usernamePrefix, $assignKnownUsers ) { $this->externalUserNames = new ExternalUserNames( $usernamePrefix, $assignKnownUsers ); }
But if setUsernamePrefix isn't called... we rely on the default assignment in the constructor of WikiImporter...
$this->externalUserNames = new ExternalUserNames( 'imported', false );
The false there would mean that local usernames are not assigned...
/** * @param string $usernamePrefix Prefix to apply to unknown (and possibly also known) usernames * @param bool $assignKnownUsers Whether to apply the prefix to usernames that exist locally */ public function __construct( $usernamePrefix, $assignKnownUsers ) { $this->usernamePrefix = rtrim( (string)$usernamePrefix, ':>' ); $this->assignKnownUsers = (bool)$assignKnownUsers; }
In Special:Import, Assign edits to local users where the named user exists locally is not enabled by default, but also setUsernamePrefix is called unconditionally (to other flags, at least)...
// @phan-suppress-next-line PhanTypeMismatchArgumentNullable False positive $importer->setUsernamePrefix( $fullInterwikiPrefix, $assignKnownUsers );