changeset 2420:144280f1578f

ssh: gather initial output so we can do capability detection
author Matt Mackall <mpm@selenic.com>
date Fri, 09 Jun 2006 17:48:14 -0500
parents b17eebc911ae
children a1cfe679192c
files mercurial/sshrepo.py
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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: