compat: drop hack around http request handling for 4.6
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 14 Mar 2018 02:32:08 +0100
changeset 3525 300d7d019b98
parent 3524 6d4095e6bdd3
child 3526 df20ddc79064
compat: drop hack around http request handling for 4.6 The approach we used in 4.5 works again :-)
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)