mercurial/debugcommands.py
changeset 37007 143219fc2620
parent 36988 317382151ac3
child 37012 fc8939825632
equal deleted inserted replaced
37006:8e89c2bec1f7 37007:143219fc2620
  2713     readline
  2713     readline
  2714     --------
  2714     --------
  2715 
  2715 
  2716     Read a line of output from the server. If there are multiple output
  2716     Read a line of output from the server. If there are multiple output
  2717     pipes, reads only the main pipe.
  2717     pipes, reads only the main pipe.
       
  2718 
       
  2719     ereadline
       
  2720     ---------
       
  2721 
       
  2722     Like ``readline``, but read from the stderr pipe, if available.
       
  2723 
       
  2724     read <X>
       
  2725     --------
       
  2726 
       
  2727     ``read()`` N bytes from the server's main output pipe.
       
  2728 
       
  2729     eread <X>
       
  2730     ---------
       
  2731 
       
  2732     ``read()`` N bytes from the server's stderr pipe, if available.
  2718     """
  2733     """
  2719     opts = pycompat.byteskwargs(opts)
  2734     opts = pycompat.byteskwargs(opts)
  2720 
  2735 
  2721     if opts['localssh'] and not repo:
  2736     if opts['localssh'] and not repo:
  2722         raise error.Abort(_('--localssh requires a repository'))
  2737         raise error.Abort(_('--localssh requires a repository'))
  2853             stdin.close()
  2868             stdin.close()
  2854             stdout.read()
  2869             stdout.read()
  2855             stderr.read()
  2870             stderr.read()
  2856         elif action == 'readline':
  2871         elif action == 'readline':
  2857             stdout.readline()
  2872             stdout.readline()
       
  2873         elif action == 'ereadline':
       
  2874             stderr.readline()
       
  2875         elif action.startswith('read '):
       
  2876             count = int(action.split(' ', 1)[1])
       
  2877             stdout.read(count)
       
  2878         elif action.startswith('eread '):
       
  2879             count = int(action.split(' ', 1)[1])
       
  2880             stderr.read(count)
  2858         else:
  2881         else:
  2859             raise error.Abort(_('unknown action: %s') % action)
  2882             raise error.Abort(_('unknown action: %s') % action)
  2860 
  2883 
  2861     if batchedcommands is not None:
  2884     if batchedcommands is not None:
  2862         raise error.Abort(_('unclosed "batchbegin" request'))
  2885         raise error.Abort(_('unclosed "batchbegin" request'))