ui: fix configwith doctest
4.2 cannot be expressed with IEEE floating point losslessly, and could
cause test failure on some platform:
File ".../mercurial/ui.py", line 414, in mercurial.ui.ui.configwith
Failed example:
u.configwith(float, s, 'float2')
Expected:
-4.2
Got:
-4.
2000000000000002
This patch fixes that by changing the number to 4.25, which can be expressed
by the binary number 100.01.
test-bdiff: move import inside the function to avoid test failure
test-check-module-imports.t fails on some systems where the path of home
directories is different than sys.prefix and sys.exec_prefix.
Importing silenttestrunner will help avoiding that failure.
profiling: add statprof support for Chrome trace viewer rendering
We synthesize function call begin/end events from snapshots, and
try (configurably) to eliminate "noisy" stack frames.
Example invocation:
hg --config profiling.output=$HOME/Desktop/clone.json \
--config profiling.statformat=chrome \
--profile clone https://www.mercurial-scm.org/repo/hg
ui: add a configwith method
This is a long-overdue generalization of the pattern in configint
and configbool.
py3: convert the mode argument of os.fdopen to unicodes (1 of 2)
os.fdopen() does not accepts bytes as its second argument which represent the
mode in which the file is to be opened. This patch makes sure unicodes are
passed in py3 by using pycompat.sysstr().