cmdserver: write channel header and payload by a single write() call
This makes a channeledoutput thread-safe as long as the underlying fwrite() is
thread-safe. Both POSIX and Windows implementations are documented as MT-safe.
MT-safety is necessary to use ui.fout and ui.ferr in hgweb.
histedit: use ui.fin to read commands from stdin
stdin is wrapped by channeledinput in command-server session.
convert: have debugsvnlog obtain standard streams from ui
This will help porting to Python 3, where sys.stdin/out/err are unfortunately
unicode streams so we can't use them directly.
convert: remove superfluous setbinary() calls from debugsvnlog
a3fe91b4f6eb made standard streams set to binary mode globally.
tests: explicitly use ls profiler
In preparation for making the statprof profiler the default.
statprof: pass data structure to display functions
Currently, statprof maintains a global "state" variable that is used by
several functions. Global variables hinder adaptability of code.
So pass state to display functions so we can make changes to how
"state" works in future patches.
statprof: use absolute_imports
As part of this, we modify import order to satisfy our import
checker.