amend: abort early if no username is configured with evolve enabled (issue4211)

Amend will reuse the original username if a new one is not provided
with -U, but obsolete.createmarkers() only considers ui.username() for
the obsolete marker's metadata. Allowing the metadata field to be
spoofed seems to defeat the point of the field in the first place.
This covers 'evolve amend' and 'ci --amend' with evolve enabled.

Without this, the transaction aborts but the parent changeset is set to -1.  The
corresponding test will be added to evolve separately.

--HG--
branch : stable
transaction: extract file generation into its own function

We extract the code generating files into its own function. We are
about to move this code around to fix a bug. We'll need it in a
function soon to reuse it for "pending" logic. So we move the code
into a function instead of moving it twice.

--HG--
branch : stable
extra : rebase_source : bc9072722915d40ba4d3d5a110d11637e80bff3e
transaction: only generate file when we actually close the transaction

Before this change, the file were written for every call to `tr.close()`
exposing data to reader far too early.

--HG--
branch : stable
extra : rebase_source : 2607769362d69327a29a88ab8e14d541e072748c
i18n-pt_BR: synchronized with c312ef382033

--HG--
branch : stable
i18n-pt_BR: synchronized with 8d43c6bb38c0

--HG--
branch : stable
merge with i18n

--HG--
branch : stable