# HG changeset patch # User Thomas Arendsen Hein # Date 1144008776 -7200 # Node ID cd77112687742dc024dbb71da417759e0e04677c # Parent 0c438fd25e6ef356a86b26aa8659d33afb757620 Don't enter an endless loop if remote hg doesn't answer, show remote noise. The endless loop is not only triggered if the remote shell is too noisy, but even if the local ssh command dies due to an error. diff --git a/mercurial/sshrepo.py b/mercurial/sshrepo.py --- a/mercurial/sshrepo.py +++ b/mercurial/sshrepo.py @@ -39,12 +39,21 @@ class sshrepository(remoterepository): # skip any noise generated by remote shell r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40))) l1 = "" - while 1: + l2 = "dummy" + max_noise = 100 + while l2 and max_noise: l2 = r.readline() self.readerr() if l1 == "1\n" and l2 == "\n": break + if l1: + ui.status(_("remote: %s") % l1) l1 = l2 + max_noise -= 1 + else: + if l1: + ui.status(_("remote: %s") % l1) + raise hg.RepoError(_("no response from remote hg")) def readerr(self): while 1: