changeset 3525:300d7d019b98

compat: drop hack around http request handling for 4.6 The approach we used in 4.5 works again :-)
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 14 Mar 2018 02:32:08 +0100
parents 6d4095e6bdd3
children df20ddc79064
files hgext3rd/evolve/obsexchange.py
diffstat 1 files changed, 1 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- 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)