mercurial/debugcommands.py
changeset 36843 31581528f242
parent 36835 5bc7ff103081
child 36951 c92d1d3c58ee
--- a/mercurial/debugcommands.py	Fri Mar 09 15:57:16 2018 +0100
+++ b/mercurial/debugcommands.py	Mon Mar 12 22:47:33 2018 +0900
@@ -2690,7 +2690,8 @@
     readavailable
     -------------
 
-    Read all available data from the server.
+    Close the write end of the connection and read all available data from
+    the server.
 
     If the connection to the server encompasses multiple pipes, we poll both
     pipes and read available data.
@@ -2835,17 +2836,9 @@
         elif action == 'close':
             peer.close()
         elif action == 'readavailable':
-            fds = [stdout.fileno(), stderr.fileno()]
-            try:
-                act = util.poll(fds)
-            except NotImplementedError:
-                # non supported yet case, assume all have data.
-                act = fds
-
-            if stdout.fileno() in act:
-                util.readpipe(stdout)
-            if stderr.fileno() in act:
-                util.readpipe(stderr)
+            stdin.close()
+            stdout.read()
+            stderr.read()
         elif action == 'readline':
             stdout.readline()
         else: