Mercurial > public > mercurial-scm > hg-stable
diff mercurial/wireprotoserver.py @ 36565: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 | 7cc4a9b9732a |
children | af0d38f015bb |
line wrap: on
line diff
--- a/mercurial/wireprotoserver.py Tue Feb 27 14:21:29 2018 -0800 +++ b/mercurial/wireprotoserver.py Tue Feb 27 14:26:00 2018 -0800 @@ -33,11 +33,8 @@ HGTYPE2 = 'application/mercurial-0.2' HGERRTYPE = 'application/hg-error' -# Names of the SSH protocol implementations. -SSHV1 = 'ssh-v1' -# This is advertised over the wire. Incremental the counter at the end -# to reflect BC breakages. -SSHV2 = 'exp-ssh-v2-0001' +SSHV1 = wireprototypes.SSHV1 +SSHV2 = wireprototypes.SSHV2 def decodevaluefromheaders(req, headerprefix): """Decode a long value from multiple HTTP request headers. @@ -324,7 +321,7 @@ @property def name(self): - return SSHV1 + return wireprototypes.SSHV1 def getargs(self, args): data = {} @@ -492,7 +489,7 @@ # We should never transition into this state if we've switched # protocols. assert not protoswitched - assert proto.name == SSHV1 + assert proto.name == wireprototypes.SSHV1 # Expected: upgrade <token> <capabilities> # If we get something else, the request is malformed. It could be