Mercurial > public > mercurial-scm > hg
comparison mercurial/sshrepo.py @ 2028:1f1fc418a96c
ssh: skip noise generated by remote shell
we send a dummy command with known output to get in sync
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 31 Mar 2006 03:25:35 -0600 |
parents | ced2d3620f95 |
children | cd7711268774 |
comparison
equal
deleted
inserted
replaced
2027:94d3170399e1 | 2028:1f1fc418a96c |
---|---|
33 cmd = '%s %s "%s -R %s serve --stdio"' | 33 cmd = '%s %s "%s -R %s serve --stdio"' |
34 cmd = cmd % (sshcmd, args, remotecmd, self.path) | 34 cmd = cmd % (sshcmd, args, remotecmd, self.path) |
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 | |
39 # skip any noise generated by remote shell | |
40 r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40))) | |
41 l1 = "" | |
42 while 1: | |
43 l2 = r.readline() | |
44 self.readerr() | |
45 if l1 == "1\n" and l2 == "\n": | |
46 break | |
47 l1 = l2 | |
38 | 48 |
39 def readerr(self): | 49 def readerr(self): |
40 while 1: | 50 while 1: |
41 size = os.fstat(self.pipee.fileno())[stat.ST_SIZE] | 51 size = os.fstat(self.pipee.fileno())[stat.ST_SIZE] |
42 if size == 0: break | 52 if size == 0: break |