rust: apply more formatting fixes
My cargo fmt updated these lines and they look good.
rust-utils: add normalize_case util to mirror Python one
While we still don't handle filenames properly cross-platform, this at least
sticks closer to the Python behavior.
Differential Revision: https://phab.mercurial-scm.org/D6756
rust: fix warnings about trait objects without dyn being deprecated
Differential Revision: https://phab.mercurial-scm.org/D6770
py3: convert hg executable path to bytes in missing case in procutil
We (Google) noticed this in our tests when we use chg and a hg wrapper
script not called 'hg'. The executable then ended up being a native
string, which then failed in chgserver when trying to convert the
environment dict to a byte string.
Differential Revision: https://phab.mercurial-scm.org/D6775
py3: make statprof's chrome output work
With this patch, this command works:
python3 hg --profile --config profiling.statformat=chrome st
(and it works with s/python3/python2/ as well)
Differential Revision: https://phab.mercurial-scm.org/D6777
py3: for statprof's Chrome output, write json to string, then encode to bytes
`json.dump(obj, fp)` requires `fp.write()` to accept str output, and
since the file pointer we have there only accepts bytes, we need to
change to json.dumps() and then encode as utf-8. We have already done
the same thing for the json (non-Chrome) format in
4b7eb862692e (py3:
encode json output to bytes and use write(), 2018-10-12).
Differential Revision: https://phab.mercurial-scm.org/D6781
statprof: use context manager for file when writing flame graph
Differential Revision: https://phab.mercurial-scm.org/D6780