# HG changeset patch # User Matt Mackall # Date 1143797135 21600 # Node ID 1f1fc418a96c9fdd10a3d87aa2b3a3f934d0ef8f # Parent 94d3170399e14a855fafbad39b6b175e239c8d7c ssh: skip noise generated by remote shell we send a dummy command with known output to get in sync diff --git a/mercurial/sshrepo.py b/mercurial/sshrepo.py --- a/mercurial/sshrepo.py +++ b/mercurial/sshrepo.py @@ -36,6 +36,16 @@ class sshrepository(remoterepository): ui.note('running %s\n' % cmd) self.pipeo, self.pipei, self.pipee = os.popen3(cmd, 'b') + # skip any noise generated by remote shell + r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40))) + l1 = "" + while 1: + l2 = r.readline() + self.readerr() + if l1 == "1\n" and l2 == "\n": + break + l1 = l2 + def readerr(self): while 1: size = os.fstat(self.pipee.fileno())[stat.ST_SIZE]