mercurial/sshrepo.py
changeset 2421 a1cfe679192c
parent 2420 144280f1578f
child 2437 2f5dbc24874a
child 2439 e8c4f3d3df8c
equal deleted inserted replaced
2420:144280f1578f 2421:a1cfe679192c
    35 
    35 
    36         ui.note('running %s\n' % cmd)
    36         ui.note('running %s\n' % cmd)
    37         self.pipeo, self.pipei, self.pipee = os.popen3(cmd, 'b')
    37         self.pipeo, self.pipei, self.pipee = os.popen3(cmd, 'b')
    38 
    38 
    39         # skip any noise generated by remote shell
    39         # skip any noise generated by remote shell
       
    40         self.do_cmd("hello")
    40         r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
    41         r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
    41         lines = ["", "dummy"]
    42         lines = ["", "dummy"]
    42         max_noise = 500
    43         max_noise = 500
    43         while lines[-1] and max_noise:
    44         while lines[-1] and max_noise:
    44             l = r.readline()
    45             l = r.readline()
    51             max_noise -= 1
    52             max_noise -= 1
    52         else:
    53         else:
    53             if l1:
    54             if l1:
    54                 ui.debug(_("remote: "), l1)
    55                 ui.debug(_("remote: "), l1)
    55             raise hg.RepoError(_("no response from remote hg"))
    56             raise hg.RepoError(_("no response from remote hg"))
       
    57 
       
    58         self.capabilities = ()
       
    59         lines.reverse()
       
    60         for l in lines:
       
    61             if l.startswith("capabilities:"):
       
    62                 self.capabilities = l[:-1].split(":")[1].split()
       
    63                 break
    56 
    64 
    57     def readerr(self):
    65     def readerr(self):
    58         while 1:
    66         while 1:
    59             size = util.fstat(self.pipee).st_size
    67             size = util.fstat(self.pipee).st_size
    60             if size == 0: break
    68             if size == 0: break