hbisect: confine loop to the relevant interval
In this context we know that ancestors[rev] == None for all rev <= goodrev,
so looping further back is unnecessary (and confusing).
win32: assign winstdout to sys.__stdout__ as well (
issue2888)
On Windows sys.stdout was being replaced with winstdout, which caused
util.system() to redirect its output (due to
406b6d7bdcb9). That causes
interactive tools (such as vim) to stop working.
hooks: redirect stdout/err/in to the ui descriptors when calling python hooks
We need to make sure that python hooks I/O goes through the ui descriptors so
it doesn't mess the command server protocol.