comparison mercurial/debugcommands.py @ 36764:7a25f6cfebe8

debugwireproto: handle unimplemented util.poll() for Windows This is the same logic used in sshpeer.doublepipe. It doesn't completely fix test-ssh-proto{,-unbundle}.t ("read(-1) -> X" is changed to "read(X) -> X", the order of some lines are changed, and abort messages seem to be missing), but it cuts down a ton on the failure spew.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 05 Mar 2018 20:22:34 -0500
parents 390d16ea7c76
children 7aae39d03139
comparison
equal deleted inserted replaced
36763:2aff6daf7790 36764:7a25f6cfebe8
2816 2816
2817 batchedcommands = None 2817 batchedcommands = None
2818 elif action == 'close': 2818 elif action == 'close':
2819 peer.close() 2819 peer.close()
2820 elif action == 'readavailable': 2820 elif action == 'readavailable':
2821 fds = util.poll([stdout.fileno(), stderr.fileno()]) 2821 fds = [stdout.fileno(), stderr.fileno()]
2822 2822 try:
2823 if stdout.fileno() in fds: 2823 act = util.poll(fds)
2824 except NotImplementedError:
2825 # non supported yet case, assume all have data.
2826 act = fds
2827
2828 if stdout.fileno() in act:
2824 util.readpipe(stdout) 2829 util.readpipe(stdout)
2825 if stderr.fileno() in fds: 2830 if stderr.fileno() in act:
2826 util.readpipe(stderr) 2831 util.readpipe(stderr)
2827 elif action == 'readline': 2832 elif action == 'readline':
2828 stdout.readline() 2833 stdout.readline()
2829 else: 2834 else:
2830 raise error.Abort(_('unknown action: %s') % action) 2835 raise error.Abort(_('unknown action: %s') % action)