# HG changeset patch # User Gregory Szorc # Date 2018-03-06 23:02:53 # Node ID 7574c8173d5edbac6a1ce1adf04d8635fc816786 # Parent d4c760c997cd6bcf4793b7ff2087c99fde99a94a wireprotoserver: check if command available before calling it The previous behavior was just plain wrong. I have no clue how it landed. My guess is a merge conflict resolution gone wrong on my end a few weeks ago. Differential Revision: https://phab.mercurial-scm.org/D2716 diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -235,14 +235,14 @@ def _callhttp(repo, req, proto, cmd): for chunk in gen: yield chunk - rsp = wireproto.dispatch(repo, proto, cmd) - if not wireproto.commands.commandavailable(cmd, proto): req.respond(HTTP_OK, HGERRTYPE, body=_('requested wire protocol command is not available ' 'over HTTP')) return [] + rsp = wireproto.dispatch(repo, proto, cmd) + if isinstance(rsp, bytes): req.respond(HTTP_OK, HGTYPE, body=rsp) return []