##// END OF EJS Templates
ssh: fix flakey ssh errors on BSD systems...
Durham Goode -
r34194:1908dc95 stable
parent child Browse files
Show More
@@ -190,23 +190,33 b' class sshpeer(wireproto.wirepeer):'
190 self.pipei = doublepipe(self.ui, self.pipei, self.pipee)
190 self.pipei = doublepipe(self.ui, self.pipei, self.pipee)
191 self.pipeo = doublepipe(self.ui, self.pipeo, self.pipee)
191 self.pipeo = doublepipe(self.ui, self.pipeo, self.pipee)
192
192
193 # skip any noise generated by remote shell
193 def badresponse():
194 self._callstream("hello")
194 self._abort(error.RepoError(_('no suitable response from '
195 r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
195 'remote hg')))
196
197 try:
198 # skip any noise generated by remote shell
199 self._callstream("hello")
200 r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
201 except IOError:
202 badresponse()
203
196 lines = ["", "dummy"]
204 lines = ["", "dummy"]
197 max_noise = 500
205 max_noise = 500
198 while lines[-1] and max_noise:
206 while lines[-1] and max_noise:
199 l = r.readline()
207 try:
200 self.readerr()
208 l = r.readline()
201 if lines[-1] == "1\n" and l == "\n":
209 self.readerr()
202 break
210 if lines[-1] == "1\n" and l == "\n":
203 if l:
211 break
204 self.ui.debug("remote: ", l)
212 if l:
205 lines.append(l)
213 self.ui.debug("remote: ", l)
206 max_noise -= 1
214 lines.append(l)
215 max_noise -= 1
216 except IOError:
217 badresponse()
207 else:
218 else:
208 self._abort(error.RepoError(_('no suitable response from '
219 badresponse()
209 'remote hg')))
210
220
211 self._caps = set()
221 self._caps = set()
212 for l in reversed(lines):
222 for l in reversed(lines):
General Comments 0
You need to be logged in to leave comments. Login now