mercurial/sshpeer.py
changeset 38475 67dc32d4e790
parent 37813 58bbd14b0c62
child 38713 27391d74aaa2
equal deleted inserted replaced
38474:96f65bdf0bf4 38475:67dc32d4e790
    20     wireprotov1peer,
    20     wireprotov1peer,
    21     wireprotov1server,
    21     wireprotov1server,
    22 )
    22 )
    23 from .utils import (
    23 from .utils import (
    24     procutil,
    24     procutil,
       
    25     stringutil,
    25 )
    26 )
    26 
    27 
    27 def _serverquote(s):
    28 def _serverquote(s):
    28     """quote a string for the remote shell ... which we assume is sh"""
    29     """quote a string for the remote shell ... which we assume is sh"""
    29     if not s:
    30     if not s:
   271     except IOError:
   272     except IOError:
   272         badresponse()
   273         badresponse()
   273 
   274 
   274     # Assume version 1 of wire protocol by default.
   275     # Assume version 1 of wire protocol by default.
   275     protoname = wireprototypes.SSHV1
   276     protoname = wireprototypes.SSHV1
   276     reupgraded = re.compile(b'^upgraded %s (.*)$' % re.escape(token))
   277     reupgraded = re.compile(b'^upgraded %s (.*)$' % stringutil.reescape(token))
   277 
   278 
   278     lines = ['', 'dummy']
   279     lines = ['', 'dummy']
   279     max_noise = 500
   280     max_noise = 500
   280     while lines[-1] and max_noise:
   281     while lines[-1] and max_noise:
   281         try:
   282         try: