# HG changeset patch # User Pierre-Yves David # Date 1520991128 -3600 # Node ID 300d7d019b9822efb797cbe5e8d888ebf40e4c31 # Parent 6d4095e6bdd306bdc90be94206fe1941d9523b7b compat: drop hack around http request handling for 4.6 The approach we used in 4.5 works again :-) diff -r 6d4095e6bdd3 -r 300d7d019b98 hgext3rd/evolve/obsexchange.py --- a/hgext3rd/evolve/obsexchange.py Wed Mar 14 02:08:53 2018 +0100 +++ b/hgext3rd/evolve/obsexchange.py Wed Mar 14 02:32:08 2018 +0100 @@ -29,7 +29,7 @@ try: from mercurial import wireprotoserver - wireprotoserver.parsehttprequest + wireprotoserver.handlewsgirequest except ImportError: wireprotoserver = None @@ -236,27 +236,6 @@ raise err return {} -if wireprotoserver is not None: - # reinstall dispatch catching ResponseError as in hg 4.5 < - @eh.wrapfunction(wireprotoserver, 'parsehttprequest') - def parsehttprequest(orig, repo, req, query): - protohandler = orig(repo, req, query) - olddispatch = protohandler['dispatch'] - - def newdispatch(*args, **kwargs): - try: - return olddispatch(*args, **kwargs) - except hgwebcommon.ErrorResponse as inst: - if protohandler['cmd'] != 'listkeys': - raise - req.headers.append((r'Connection', r'Close')) - req.respond(inst, wireprotoserver.HGTYPE, - body='0\n%s\n' % inst) - return '' - - protohandler['dispatch'] = newdispatch - return protohandler - @eh.uisetup def setuppushkeyforbidding(ui): pushkey._namespaces['obsolete'] = (forbidpushkey, forbidlistkey)