ssh: gather initial output so we can do capability detection
authorMatt Mackall <mpm@selenic.com>
Fri, 09 Jun 2006 17:48:14 -0500
changeset 2420 144280f1578f
parent 2419 b17eebc911ae
child 2421 a1cfe679192c
ssh: gather initial output so we can do capability detection
mercurial/sshrepo.py
--- a/mercurial/sshrepo.py	Fri Jun 09 17:47:38 2006 -0500
+++ b/mercurial/sshrepo.py	Fri Jun 09 17:48:14 2006 -0500
@@ -38,17 +38,16 @@
 
         # skip any noise generated by remote shell
         r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
-        l1 = ""
-        l2 = "dummy"
+        lines = ["", "dummy"]
         max_noise = 500
-        while l2 and max_noise:
-            l2 = r.readline()
+        while lines[-1] and max_noise:
+            l = r.readline()
             self.readerr()
-            if l1 == "1\n" and l2 == "\n":
+            if lines[-1] == "1\n" and l == "\n":
                 break
-            if l1:
-                ui.debug(_("remote: "), l1)
-            l1 = l2
+            if l:
+                ui.debug(_("remote: "), l)
+            lines.append(l)
             max_noise -= 1
         else:
             if l1: