comparison mercurial/sshrepo.py @ 2420:144280f1578f

ssh: gather initial output so we can do capability detection
author Matt Mackall <mpm@selenic.com>
date Fri, 09 Jun 2006 17:48:14 -0500
parents 332950340788
children a1cfe679192c
comparison
equal deleted inserted replaced
2419:b17eebc911ae 2420:144280f1578f
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 r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40))) 40 r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
41 l1 = "" 41 lines = ["", "dummy"]
42 l2 = "dummy"
43 max_noise = 500 42 max_noise = 500
44 while l2 and max_noise: 43 while lines[-1] and max_noise:
45 l2 = r.readline() 44 l = r.readline()
46 self.readerr() 45 self.readerr()
47 if l1 == "1\n" and l2 == "\n": 46 if lines[-1] == "1\n" and l == "\n":
48 break 47 break
49 if l1: 48 if l:
50 ui.debug(_("remote: "), l1) 49 ui.debug(_("remote: "), l)
51 l1 = l2 50 lines.append(l)
52 max_noise -= 1 51 max_noise -= 1
53 else: 52 else:
54 if l1: 53 if l1:
55 ui.debug(_("remote: "), l1) 54 ui.debug(_("remote: "), l1)
56 raise hg.RepoError(_("no response from remote hg")) 55 raise hg.RepoError(_("no response from remote hg"))