# HG changeset patch # User Gregory Szorc # Date 2018-04-12 01:15:51 # Node ID 77c9ee77687cafdaa829533bb62d0ed5d93dcb52 # Parent 1aa4d646d0de30a453b5e9fe2aabd5937d49c1ad wireproto: rename HTTPV2 so it less like HTTP/2 Per review suggestion on D3230 from Augie. Differential Revision: https://phab.mercurial-scm.org/D3295 diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -2912,7 +2912,7 @@ def debugwireproto(ui, repo, path=None, if opts['peer'] == 'http2': ui.write(_('creating http peer for wire protocol version 2\n')) peer = httppeer.httpv2peer( - ui, path, 'api/%s' % wireprototypes.HTTPV2, + ui, path, 'api/%s' % wireprototypes.HTTP_WIREPROTO_V2, opener, httppeer.urlreq.request, {}) elif opts['peer'] == 'raw': ui.write(_('using raw connection to peer\n')) diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py --- a/mercurial/httppeer.py +++ b/mercurial/httppeer.py @@ -672,7 +672,7 @@ class httpv2peer(object): # Integer priority for the service. If we could choose from multiple # services, we choose the one with the highest priority. API_PEERS = { - wireprototypes.HTTPV2: { + wireprototypes.HTTP_WIREPROTO_V2: { 'init': httpv2peer, 'priority': 50, }, diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -307,7 +307,7 @@ def handlewsgiapirequest(rctx, req, res, # Callable receiving (req, repo) that is called to obtain an API # descriptor for this service. The response must be serializable to CBOR. API_HANDLERS = { - wireprotov2server.HTTPV2: { + wireprotov2server.HTTP_WIREPROTO_V2: { 'config': ('experimental', 'web.api.http-v2'), 'handler': wireprotov2server.handlehttpv2request, 'apidescriptor': wireprotov2server.httpv2apidescriptor, diff --git a/mercurial/wireprototypes.py b/mercurial/wireprototypes.py --- a/mercurial/wireprototypes.py +++ b/mercurial/wireprototypes.py @@ -18,7 +18,7 @@ SSHV1 = 'ssh-v1' # These are advertised over the wire. Increment the counters at the end # to reflect BC breakages. SSHV2 = 'exp-ssh-v2-0001' -HTTPV2 = 'exp-http-v2-0001' +HTTP_WIREPROTO_V2 = 'exp-http-v2-0001' # All available wire protocol transports. TRANSPORTS = { @@ -35,7 +35,7 @@ TRANSPORTS = { 'transport': 'http', 'version': 1, }, - HTTPV2: { + HTTP_WIREPROTO_V2: { 'transport': 'http', 'version': 2, } diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py --- a/mercurial/wireprotov2server.py +++ b/mercurial/wireprotov2server.py @@ -27,7 +27,7 @@ from . import ( FRAMINGTYPE = b'application/mercurial-exp-framing-0003' -HTTPV2 = wireprototypes.HTTPV2 +HTTP_WIREPROTO_V2 = wireprototypes.HTTP_WIREPROTO_V2 def handlehttpv2request(rctx, req, res, checkperm, urlparts): from .hgweb import common as hgwebcommon @@ -332,7 +332,7 @@ class httpv2protocolhandler(object): @property def name(self): - return HTTPV2 + return HTTP_WIREPROTO_V2 def getargs(self, args): data = {}