Resolve accounts by imported externalId

When an account's serverId does not match the one defined in
gerrit.config, then use the 'imported' external ids in the accounts
for reverse lookup of the accountId.

This allows to correctly understand and associate the imported
changes coming from repositories of other Gerrit servers to
the correct accounts locally.

Example scenario:

User John has account 100 on Gerrit A having serverId=server-id-a
and creates a Change A.
The same user registers later on Gerrit B having serverId=server-id-b
and is associated with the account 200.

Gerrit B's config set importedServerId=server-id-a,
the repository containing Change A is copied to Gerrit B and
the Gerrit admin runs a reindex on it.

By adding the additional externalId=imported:100@server-id-a the
ChangeNotesParser can lookup the correct account-id when parsing
the Change A.

When browsing Change A on Gerrit A or Gerrit B, John appears
to be the owner of the change on both of them, even if he has
two different accountIds on the two severs.

Release-Notes: Allows to lookup Change's accounts by importedServerIds.
Forward-Compatible: checked
Change-Id: I2f017af1cbb9f584e06152407cf864503738afb0
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index 365a26e..be6e140 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -2549,9 +2549,14 @@
 associated with the imported serverIds are indexed and displayed in the UI.
 +
 Specify multiple `gerrit.importedServerId` for allowing the import from multiple
-Gerrit servers with different serverIds. The servers associated with the imported
-serverIds need to have the same or a subset of the account Ids of the hosting
-Gerrit server.
+Gerrit servers with different serverIds.
++
+[NOTE]
+The account-ids referenced in the imported changes are used for looking up the
+associated account-id locally, using the `imported:` external-id.
+Example: the account-id 1000 from the imported server-id 59a4964e-6376-4ed9-beef
+will be looked up in the local accounts using the `imported:1000@59a4964e-6376-4ed9-beef`
+external-id.
 +
 If this value is not set, all changes imported from other Gerrit servers will be
 ignored.