Patchwork D3183: wireproto: only expose "hello" command to version 1 transports

login
register
mail settings
Submitter phabricator
Date April 7, 2018, 5:53 a.m.
Message ID <differential-rev-PHID-DREV-24m4es7aeh3kfjc7wovp-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30528/
State Superseded
Headers show

Comments

phabricator - April 7, 2018, 5:53 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This command is only ever used for the handshake in the SSH protocol.
  We probably don't even need for it to be a proper command. Let's not
  carry it forward to version 2 because I don't see a use for it there.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3183

AFFECTED FILES
  mercurial/wireproto.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -1010,7 +1010,7 @@ 
     h = repo.heads()
     return wireprototypes.bytesresponse(encodelist(h) + '\n')
 
-@wireprotocommand('hello', permission='pull')
+@wireprotocommand('hello', permission='pull', transportpolicy=POLICY_V1_ONLY)
 def hello(repo, proto):
     """Called as part of SSH handshake to obtain server info.