Handling of usernames in imported edits in MediaWiki has long been weird (T9240 was filed in 2006!).
If a local user does not exist with the same username as the author of an imported revision, we get a strange row in the revision table where rev_user_text is a valid but non-existent username and rev_user is 0. A rev_user value of 0 typically indicates an IP edit. Someone can later create a user with that username, but rev_user remains 0 for all existing revisions with that username. Depending on whether a tool looks at rev_user_text or rev_user, old revisions may or may not be considered to actually belong to the newly-created user.
If a local user with the same username as the author of an imported revision does exist when the import is done, the edit is attributed to that user regardless of whether it's actually the same person. See T179246 for an example where imported edits got attributed to the wrong account in pre-SUL times.
- If revisions are imported using the "Upload XML data" method, a new mandatory field, which is intended to be interpreted as an interwiki prefix, must be populated to indicate the source of the edits.
- If revisions are imported using the."Import from another wiki" method, the interwiki prefix of the specified source wiki will be used as the source.
- During the import, any usernames that don't exist locally and cannot be auto-created via CentralAuth (T111605) or another authentication mechanism will be imported as an otherwise-invalid name. For example, an edit by a user with username Example from source 'en' would be imported as 'en>Example'  if a user with username Example does not exist and cannot be auto-created on the local wiki.
- There will be a checkbox on Special:Import to specify whether the same should be done for usernames that do exist locally (or can be auto-created) or whether those edits should be attributed to the existing/auto-created local user.
- On history pages, log pages, and the like, these usernames will be displayed as interwiki links, much as might be generated by wikitext like "[[:en:User:Example|en>Example]]". No parenthesized 'tool' links (talk, block, and so on) will be generated for these rows.
- On WMF wikis, we'll run a maintenance script to clean up the existing rows with valid usernames and rev_user = 0. The current plan there is to attribute these edits to existing SUL users where possible and to prefix them with a generic prefix otherwise, but we could as easily prefix them all. Similar scripts could be written for non-WMF wikis.
- Unfortunately it's impossible to retroactively determine the actual source of old imports automatically or to automatically do anything about imports that were misattributed to a different local user in pre-SUL times (e.g. T179246).
- The same will be done for CentralAuth's global suppression blocks. In this case, on WMF wikis we can safely point them all at Meta.
Background: The upcoming actor table changes, T167246, require some change to the handling of these imported names because we can't have separate attribution to "Example as a non-registered user" and "Example as a registered user" with the new schema. The options we've identified are:
- This proposal, or something much like it.
- All the existing rows with rev_user = 0 would have to be attributed to the existing local user (if any), and in the future when a new user is created any existing edits attributed to that name will be automatically attributed to that new account.
- All the existing rows with rev_user = 0 and an existing local user would have to be re-attributed to different *valid* usernames, probably randomly-generated in some manner, and in the future when a new user is created any existing edits for that name would have to be similarly re-attributed.
- Like #2, except the creation (including SUL auto-creation) of the same-named account would not be allowed. Thus, an import before the local name exists would forever block that name from being used for an actual local account.
- Some less consistent combination of the "all the existing rows" and "when a new user is created" options from #2–4.
Of these options, this proposal seems like the best one.
: ">" was chosen rather than the more typical ":" because the former is already invalid in all usernames (and page titles). While a colon is *now* disallowed in new usernames, existing names created before that restriction was added can continue to be used (and there are over 12000 such usernames in WMF's SUL) and we decided it'd be better not to suddenly break them.