mercurial/debugcommands.py
changeset 37007 143219fc2620
parent 36988 317382151ac3
child 37012 fc8939825632
--- a/mercurial/debugcommands.py	Wed Mar 07 20:41:59 2018 -0800
+++ b/mercurial/debugcommands.py	Mon Mar 12 15:49:02 2018 -0700
@@ -2715,6 +2715,21 @@
 
     Read a line of output from the server. If there are multiple output
     pipes, reads only the main pipe.
+
+    ereadline
+    ---------
+
+    Like ``readline``, but read from the stderr pipe, if available.
+
+    read <X>
+    --------
+
+    ``read()`` N bytes from the server's main output pipe.
+
+    eread <X>
+    ---------
+
+    ``read()`` N bytes from the server's stderr pipe, if available.
     """
     opts = pycompat.byteskwargs(opts)
 
@@ -2855,6 +2870,14 @@
             stderr.read()
         elif action == 'readline':
             stdout.readline()
+        elif action == 'ereadline':
+            stderr.readline()
+        elif action.startswith('read '):
+            count = int(action.split(' ', 1)[1])
+            stdout.read(count)
+        elif action.startswith('eread '):
+            count = int(action.split(' ', 1)[1])
+            stderr.read(count)
         else:
             raise error.Abort(_('unknown action: %s') % action)