windows: gracefully handle when the username cannot be determined
This assumes implementation details, but I don't see any other way than to check
the environment variables ourselves (which would miss out on any future
enhancements that Python may make). This was originally reported as
https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5835.
#require rustfmt test-repo
$ . "$TESTDIR/helpers-testrepo.sh"
$ cd "$TESTDIR"/..
Warning: Keep this in sync with hghave.py
$ RUSTFMT=$(rustup which --toolchain nightly-2021-11-02 rustfmt)
$ for f in `testrepohg files 'glob:**/*.rs'` ; do
> $RUSTFMT --check --edition=2018 --unstable-features --color=never $f
> done