diff mercurial/sshpeer.py @ 36536:3cd245945ef3

wireprotoserver: move SSHV1 and SSHV2 constants to wireprototypes To avoid a cycle between modules in an upcoming commit. Differential Revision: https://phab.mercurial-scm.org/D2482
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 27 Feb 2018 14:26:00 -0800
parents 1a36ef7df70a
children 1151c731686e
line wrap: on
line diff
--- a/mercurial/sshpeer.py	Tue Feb 27 14:21:29 2018 -0800
+++ b/mercurial/sshpeer.py	Tue Feb 27 14:26:00 2018 -0800
@@ -17,6 +17,7 @@
     util,
     wireproto,
     wireprotoserver,
+    wireprototypes,
 )
 
 def _serverquote(s):
@@ -257,7 +258,7 @@
         badresponse()
 
     # Assume version 1 of wire protocol by default.
-    protoname = wireprotoserver.SSHV1
+    protoname = wireprototypes.SSHV1
     reupgraded = re.compile(b'^upgraded %s (.*)$' % re.escape(token))
 
     lines = ['', 'dummy']
@@ -296,7 +297,7 @@
 
     # For version 1, we should see a ``capabilities`` line in response to the
     # ``hello`` command.
-    if protoname == wireprotoserver.SSHV1:
+    if protoname == wireprototypes.SSHV1:
         for l in reversed(lines):
             # Look for response to ``hello`` command. Scan from the back so
             # we don't misinterpret banner output as the command reply.
@@ -555,10 +556,10 @@
         _cleanuppipes(ui, stdout, stdin, stderr)
         raise
 
-    if protoname == wireprotoserver.SSHV1:
+    if protoname == wireprototypes.SSHV1:
         return sshv1peer(ui, path, proc, stdin, stdout, stderr, caps,
                          autoreadstderr=autoreadstderr)
-    elif protoname == wireprotoserver.SSHV2:
+    elif protoname == wireprototypes.SSHV2:
         return sshv2peer(ui, path, proc, stdin, stdout, stderr, caps,
                          autoreadstderr=autoreadstderr)
     else: