mercurial/sshpeer.py
changeset 35940 556218e08e25
parent 35939 a622a927fe03
child 35976 48a3a9283f09
--- a/mercurial/sshpeer.py	Sun Feb 04 14:44:04 2018 -0800
+++ b/mercurial/sshpeer.py	Sun Feb 04 14:58:32 2018 -0800
@@ -242,6 +242,16 @@
             caps.update(l[:-1].split(':')[1].split())
             break
 
+    # Error if we couldn't find a response to ``hello``. This could
+    # mean:
+    #
+    # 1. Remote isn't a Mercurial server
+    # 2. Remote is a <0.9.1 Mercurial server
+    # 3. Remote is a future Mercurial server that dropped ``hello``
+    #    support.
+    if not caps:
+        badresponse()
+
     return caps
 
 class sshpeer(wireproto.wirepeer):