Mercurial > hg-stable
changeset 36261:2e07dc514073
wireprotoserver: add version to HTTP protocol name (API)
This matches what we did for the SSH protocol handler in
ac33dc94e1d5.
.. api::
HTTP protocol handlers now advertises its internal name as
``http-v1`` instead of ``http``.
Differential Revision: https://phab.mercurial-scm.org/D2219
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 12 Feb 2018 17:20:20 -0800 |
parents | 6ba5b03f3645 |
children | d0a3fa849cb8 |
files | mercurial/wireproto.py mercurial/wireprotoserver.py |
diffstat | 2 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/wireproto.py Mon Feb 12 17:19:51 2018 -0800 +++ b/mercurial/wireproto.py Mon Feb 12 17:20:20 2018 -0800 @@ -778,7 +778,7 @@ caps.append('bundle2=' + urlreq.quote(capsblob)) caps.append('unbundle=%s' % ','.join(bundle2.bundlepriority)) - if proto.name == 'http': + if proto.name == 'http-v1': caps.append('httpheader=%d' % repo.ui.configint('server', 'maxhttpheaderlen')) if repo.ui.configbool('experimental', 'httppostargs'): @@ -852,7 +852,7 @@ if not bundle1allowed(repo, 'pull'): if not exchange.bundle2requested(opts.get('bundlecaps')): - if proto.name == 'http': + if proto.name == 'http-v1': return ooberror(bundle2required) raise error.Abort(bundle2requiredmain, hint=bundle2requiredhint) @@ -878,7 +878,7 @@ except error.Abort as exc: # cleanly forward Abort error to the client if not exchange.bundle2requested(opts.get('bundlecaps')): - if proto.name == 'http': + if proto.name == 'http-v1': return ooberror(str(exc) + '\n') raise # cannot do better for bundle1 + ssh # bundle2 request expect a bundle2 reply @@ -983,7 +983,7 @@ gen = exchange.readbundle(repo.ui, fp, None) if (isinstance(gen, changegroupmod.cg1unpacker) and not bundle1allowed(repo, 'push')): - if proto.name == 'http': + if proto.name == 'http-v1': # need to special case http because stderr do not get to # the http client on failed push so we need to abuse # some other error type to make sure the message get to